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

MutableHeaders

class MutableHeaders : Headers, MutableIterable<Header> (source)

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

Constructors

Name Summary
<init> MutableHeaders(vararg pairs: Pair<String, String>)MutableHeaders(headers: List<Header>)
A collection of HTTP Headers (mutable) of a Request or Response.

Properties

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

Functions

Name Summary
append fun append(name: String, value: String): MutableHeaders
Append a header without removing the headers already present.
contains operator fun contains(name: String): Boolean
Returns true if a Header with the given name exists.
equals fun equals(other: Any?): Boolean
get fun get(index: Int): Header
Gets the Header at the specified index.fun get(name: String): String?
Returns the last value corresponding to the specified header field name. Or null if the header does not exist.
getAll fun getAll(name: String): List<String>
Returns the list of values corresponding to the specified header field name.
hashCode fun hashCode(): Int
iterator fun iterator(): MutableIterator<Header>
Returns an iterator over the headers that supports removing elements during iteration.
set fun set(index: Int, header: Header): Unit
Sets the Header at the specified index.fun set(name: String, value: String): MutableHeaders
Set the only occurrence of the header; potentially overriding an already existing header.

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>