HttpHeaders

This class represents HTTP request/response headers. It is essentially a multimap of header names (strings) and their corresponding values (strings).

Important: This is a Public Preview API. It may be changed or removed at any time.

Types

Link copied to clipboard
class Builder

The builder class for HttpHeaders.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val size: Int

The total number of header entries.

Functions

Link copied to clipboard
operator fun get(name: String): String?

Returns the value of the header with the specified name.

Link copied to clipboard
open operator override fun iterator(): Iterator<HttpHeader>

Returns an iterator over the header name-value pairs.

Link copied to clipboard

Creates a new HttpHeaders instance based on this object, using a Kotlin domain-specific language (DSL) builder.

Link copied to clipboard
fun names(): Set<String>

Returns a set containing the names of all headers.

Link copied to clipboard

Returns Builder that is initialized with the header values.

Link copied to clipboard
fun value(name: String): String?

Returns the value of the header with the specified name. If the header has multiple values, only the last value is returned.

Link copied to clipboard
fun values(name: String): List<String>

Returns a list of values for the header with the specified name.

Inherited functions

Link copied to clipboard
open fun forEach(p0: Consumer<in HttpHeader>)
Link copied to clipboard