addHeader method
Convenience method to add a header to the request. Returns a new instance of HttpRequest with the added header.
Implementation
HttpRequest addHeader({
required HttpHeaderName name,
required String value,
}) {
return copyWith(
headers: (headers ?? HttpHeaders.empty).copyWith(
name: name,
value: value,
),
);
}