headers

fun headers(configure: HttpHeaders.Builder.() -> Unit)(source)

Edits this call's request headers, which start as the client's default headers: add appends, set and setSensitive replace, remove drops. Several blocks edit the same builder. Per-call headers are not part of the cache key: do not use one that changes the answer on a cached endpoint.

Parameters

configure

the edits; a bad name or value throws IllegalArgumentException, which the call turns into an InvalidRequest.

Throws

if an edit uses an invalid header name or value; inside call's lambda the call returns it as an InvalidRequest.