headersBuilder

protected open fun headersBuilder(): Headers.Builder(source)

Headers builder for requests. Implementations can override this method for custom headers.

Usage examples:

// Adds headers to the default [Headers.Builder] instance, retaining
// headers like the default(or user-made) User-Agent.
override fun headersBuilder() = super.headersBuilder().add("Referer", baseUrl)
// Creates a new, empty [Headers.Builder] instance and adds a single header.
override fun headersBuilder() = Headers.Builder().add("Referer", baseUrl)