finalizeBody method
Finalize the request body. If a body was supplied to the request dispatch
method, it will be available as body
. Otherwise the body from this
request should be used.
This logic is platform-specific and should be implemented by the subclass.
Implementation
@override
Future<HttpBody> finalizeBody([dynamic body]) async {
if (body != null) {
if (body is Map<String, dynamic>) {
fields = body;
} else {
throw ArgumentError.value(
body, 'body', 'Body must be of type Map<String, dynamic>');
}
}
return HttpBody.fromBytes(contentType, _encodedQuery,
fallbackEncoding: encoding);
}