replace method
Create a new Response using all the values from this instance except for the parameters specified.
Implementation
Response replace(
{List<int>? bodyBytes,
String? bodyString,
int? status,
String? statusText,
Map<String, String>? headers}) {
status = status ?? this.status;
statusText = statusText ?? this.statusText;
headers = headers ?? this.headers;
if (bodyBytes == null) {
if (bodyString == null) {
return Response._(status, statusText, headers, _body);
} else {
return Response.fromString(status, statusText, headers, bodyString);
}
} else {
return Response.fromBytes(status, statusText, headers, bodyBytes);
}
}