copyWith method
Creates a copy of this request with the specified fields replaced.
Useful in middleware pipelines for mutating request context, headers, or parameters.
Implementation
BloomRequest copyWith({
String? method,
Uri? uri,
Map<String, String>? headers,
Map<String, String>? params,
Uint8List? rawBody,
Stream<List<int>>? streamBody,
int? maxRequestBodyBytes,
bool? isSecure,
}) {
return BloomRequest(
method: method ?? this.method,
uri: uri ?? this.uri,
headers: headers ?? this.headers,
params: params ?? this.params,
rawBody: rawBody ?? _rawBody,
streamBody: streamBody ?? _streamBody,
maxRequestBodyBytes: maxRequestBodyBytes ?? _maxRequestBodyBytes,
isSecure: isSecure ?? this.isSecure,
);
}