send<ResponseType> method

  1. @protected
Future<ResponseType> send<ResponseType>(
  1. BaseRequest request, {
  2. Map<String, String>? headers,
  3. JsonDeserializer<ResponseType>? responseDeserializer,
})

Implementation

@protected
Future<ResponseType> send<ResponseType>(
  http.BaseRequest request, {
  Map<String, String>? headers,
  JsonDeserializer<ResponseType>? responseDeserializer,
}) async {
  if (headers != null) {
    request.headers.addAll(headers);
  }

  log.finest(() =>
      'Sending a ${request.method.toUpperCase()} request to ${request.url}');

  return _handleResponse<ResponseType>(
    request,
    await http.Response.fromStream(await _httpClient.send(request)),
    responseDeserializer: responseDeserializer,
  );
}