copyWith method

  1. @override
Request copyWith({
  1. Uri? url,
  2. Headers? headers,
  3. Body? body,
})
override

Creates a new Request by copying existing values and applying specified changes.

All parameters are optional. If not provided, the original values are used.

Implementation

@override
Request copyWith({final Uri? url, final Headers? headers, final Body? body}) {
  return Request._(
    method,
    url ?? this.url,
    token,
    headers: headers ?? this.headers,
    protocolVersion: protocolVersion,
    body: body ?? this.body,
    connectionInfo: connectionInfo,
  );
}