android-components / mozilla.components.concept.fetch / Headers

Headers

interface Headers : Iterable<Header> (source)

A collection of HTTP Headers (immutable) of a Request or Response.

Properties

size

abstract val size: Int

Returns the number of headers (key / value combinations).

Functions

contains

abstract operator fun contains(name: String): Boolean

Returns true if a Header with the given name exists.

get

abstract operator fun get(index: Int): Header

Gets the Header at the specified index.

abstract operator fun get(name: String): String?

Returns the last values corresponding to the specified header field name. Or null if the header does not exist.

getAll

abstract fun getAll(name: String): List<String>

Returns the list of values corresponding to the specified header field name.

set

abstract operator fun set(index: Int, header: Header): Unit

Sets the Header at the specified index.

Inheritors

MutableHeaders

class MutableHeaders : Headers, MutableIterable<Header>

A collection of HTTP Headers (mutable) of a Request or Response.