copyWith method

HTTPRequestData copyWith({
  1. Map<String, dynamic>? headers,
  2. Uri? uri,
  3. String? method,
  4. Map<String, dynamic>? data,
  5. int? requestId,
})

Creates a copy of this HTTPRequestData with the given parameters, allowing for modification of certain fields while keeping others from the original object.

Implementation

HTTPRequestData copyWith({
  Map<String, dynamic>? headers,
  Uri? uri,
  String? method,
  Map<String, dynamic>? data,
  int? requestId,
}) {
  return HTTPRequestData(
    headers: headers ?? this.headers,
    uri: uri ?? this.uri,
    method: method ?? this.method,
    data: data ?? this.data,
    requestId: requestId ?? this.requestId,
  );
}