HttpRequest.withHeader

HttpRequest withHeader(string name, string value) const

Returns a copy of this request with an additional/replaced header.

Parameters

nameHeader name; must not be empty.
valueHeader value.

Returns

The modified copy; the original request is unchanged.

Throws

HttpException when name is empty.