Builder

class Builder

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

This class is not thread safe.

This class may include default values for User-Agent and Accept-Encoding headers. These will be replaced by calls to either setHeader or addHeader, even though addHeader would usually append an additional value.

Functions

Link copied to clipboard
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.
open fun addHeader(key: String, value: String): LazyHeaders.Builder
Adds a value for the given header and returns this builder.
Link copied to clipboard
open fun build(): LazyHeaders
Returns a new immutable LazyHeaders object.
Link copied to clipboard
open fun setHeader(key: String, factory: LazyHeaderFactory): LazyHeaders.Builder
open fun setHeader(key: String, value: String): LazyHeaders.Builder
Replaces all existing LazyHeaderFactorys for the given key with the given LazyHeaderFactory.