copyWith method
Creates a copy of this HTTPResponseData with the given parameters, allowing for modification of certain fields while keeping others from the original object.
Implementation
HTTPResponseData copyWith({
Map<String, dynamic>? headers,
int? statusCode,
DataType? data,
String? statusMessage,
String? error,
}) {
return HTTPResponseData(
headers: headers ?? this.headers,
statusCode: statusCode ?? this.statusCode,
data: data ?? this.data,
statusMessage: statusMessage ?? this.statusMessage,
error: error ?? this.error,
);
}