copyWith method

RequestEntity copyWith({
  1. Map<String, Object>? headers,
  2. Object? body,
  3. Encoding? encoding,
  4. Map<String, Object>? context,
})

Implementation

RequestEntity copyWith({
  Map<String, /* String | List<String> */ Object>? headers,
  Object? body,
  Encoding? encoding,
  Map<String, Object>? context,
}) {
  return RequestEntity(
    method,
    requestedUri,
    url: url,
    protocolVersion: protocolVersion,
    pathTemplate: pathTemplate,
    handlerPath: handlerPath,
    body: body ?? _cachedBody ?? read(),
    headers: headers ?? this.headers,
    encoding: encoding ?? this.encoding,
    context: context ?? this.context,
  );
}