makeRequest method

  1. @override
Request makeRequest(
  1. String method,
  2. Uri url, {
  3. Map<String, String>? headers,
  4. Object? body,
  5. Encoding? encoding,
})

Creates a new Request instance with the given parameters.

Implementation

@override
Request makeRequest(
  String method,
  Uri url, {
  Map<String, String>? headers,
  Object? body,
  Encoding? encoding,
}) {
  url = url.replace(
      scheme: url.scheme.isEmpty ? 'http' : url.scheme,
      host: url.host.isEmpty ? _server?.url.host : host,
      port: url.port == 0 ? _server?.url.port : port);

  return Request(method, url, //
      headers: headers,
      body: body,
      encoding: encoding);
}