cloneWith method

Future<Request> cloneWith({
  1. Map<String, String>? headers,
})

Creates a new Request instance with the same content and headers, appending the specified values from headers Map.

Implementation

Future<Request> cloneWith({Map<String, String>? headers}) async {
  return Request._(facade.Request(
    clone()._delegate,
    facade.RequestInit(
        headers: this.headers.clone(headers: headers)._delegate),
  ));
}