request method
Implementation
@override
Future<HttpResponse> request(String url,
{String method, String data, Map<String, String> headers}) async {
numOutstanding++;
if (debugPrint != null) debugPrint('HTTP Request: $url');
http.Client client = clientFactory();
var uriResponse;
switch (method) {
case 'POST':
uriResponse =
await client.post(Uri.parse(url), body: data, headers: headers);
break;
default:
uriResponse = await client.get(Uri.parse(url), headers: headers);
break;
}
HttpResponse ret =
HttpResponse(uriResponse.statusCode, text: uriResponse.body);
if (debugPrint != null) {
debugPrint('HTTP Response=${ret.status}: ${ret.text}');
}
numOutstanding--;
return ret;
}