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

Headers

interface Headers : Iterable<Header> (source)

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

Types

Name Summary
Names object Names
A collection of common HTTP header names.
Values object Values
A collection of common HTTP header values.

Properties

Name Summary
size abstract val size: Int
Returns the number of headers (key / value combinations).

Functions

Name Summary
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.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.
toJSONArray fun Iterable<Any>.toJSONArray(): <ERROR CLASS>

Inheritors

Name Summary
MutableHeaders class MutableHeaders : Headers, MutableIterable<Header>
A collection of HTTP Headers (mutable) of a Request or Response.