build method
Implementation
Future<Response> build () async {
final Map<String, String> fields = {};
StreamedResponse response;
if (httpFiles.isNotEmpty) {
final request = MultipartRequest(httpMethod.uid, Uri.parse('$httpBaseUrl$httpUrl'))
..files.addAll(httpFiles)
..fields.addAll(fields)
..headers.addAll(httpHeaders);
response = await request.send();
} else {
final request = Request(httpMethod.uid, Uri.parse('$httpBaseUrl$httpUrl'))
..body = jsonEncode(httpPayload)
..headers.addAll(httpHeaders);
response = await request.send();
}
return Response.bytes(await response.stream.toBytes(), response.statusCode);
}