addHeader

open fun addHeader(key: String, value: String): LazyHeaders.Builder

Adds a value for the given header and returns this builder.

Use addHeader if obtaining the value requires I/O (i.e. an OAuth token).

See also


open fun addHeader(key: String, factory: LazyHeaderFactory): LazyHeaders.Builder

Adds an LazyHeaderFactory that will be used to construct a value for the given key lazily on a background thread.

Headers may have multiple values whose order is defined by the order in which this method is called.

This class does not prevent you from adding the same value to a given key multiple times