header

open override fun header(name: String, value: String)

Adds a header to the request.

Headers are added to the request and sent to the server. Multiple calls with the same header name will append additional values rather than replacing the previous value.

Parameters

name

The header name (case-insensitive).

value

The header value (case-sensitive).


open override fun header(name: String): String?

Retrieves the value(s) of a header by name.

Return

The header value(s) as a string, or null if the header doesn't exist.

Parameters

name

The header name (case-insensitive).