AWSRequest.formData constructor
AWSRequest.formData(})
Creates a new HTTP request with url-encoded form data
based on params
argument.
It automatically sets the method to 'POST' and content-type
header value to application/x-www-form-urlencoded; charset=UTF-8
.
Implementation
factory AWSRequest.formData(
dynamic url, {
Map<String, dynamic>? body,
Map<String, String>? queryParameters,
Map<String, String>? headers,
}) {
var request = AWSRequest(
url,
method: 'POST',
queryParameters: queryParameters,
headers: headers,
body:
body != null ? utf8.encode(_createFormDataBody(body)) : Uint8List(0),
);
// override content-type header
request.contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
return request;
}