HttpHeaders

open class HttpHeaders

Encapsulates a map of HTTP headers, allowing case-insensitive lookup.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val isEmpty: Boolean
Link copied to clipboard
open val size: Int

Functions

Link copied to clipboard
open fun addAll(other: HttpHeaders)

Add all of the headers from another headers object into this headers object.

Link copied to clipboard
open fun clear()

Clear all the headers.

Link copied to clipboard

Return this headers object, configured to allow safe concurrent read/write access.

Link copied to clipboard
open fun copy(): HttpHeaders

Return a copy of these headers.

Link copied to clipboard
open fun delete(name: String): Boolean

For internal use only.

Link copied to clipboard

Return the header entries (name/value pairs).

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare this HttpHeaders keys/values with another HttpHeaders keys/values for equality.

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

Return (nullable) The value of a header, or null if not found.

Link copied to clipboard
open fun has(name: String): Boolean

Return true if a specified header exists.

Link copied to clipboard
open override fun hashCode(): Int

Return a hash code for this HttpHeaders.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.core.PearsonHashing}.

Link copied to clipboard
open fun keys(): StringList

Return the header names.

Link copied to clipboard
open fun parse(text: String, request: HttpRequest?)

For internal use only.

Link copied to clipboard
open fun remove(name: String): Boolean

Remove the value of a header, if present.

Link copied to clipboard
open fun set(name: String, value: String)

Set the value of a header.

Link copied to clipboard

Return the header entries (name/value pairs) sorted by name (case insensitive).

Link copied to clipboard

Return the header names in sorted order.

Link copied to clipboard
open override fun toString(): String

Return headers as a JSON string.

Link copied to clipboard

Return headers as a JSON string, that the key field is lower case.

Link copied to clipboard
open fun with(name: String, value: String): HttpHeaders

Set the value of a header.

Link copied to clipboard

Equivalent to withData("X-Client-Credentials", value).

Link copied to clipboard

Equivalent to withData("X-Create-Parameters", value).

Link copied to clipboard
open fun withData(header: String, value: Any?): HttpHeaders

Convert value to OData 4.0 JSON format, then set a header with the JSON-encoded value as a data URI with media type "application/json" and base64-encoded data.

Link copied to clipboard

Equivalent to withData("X-Delete-Parameters", parameters).

Link copied to clipboard

Equivalent to withData("X-Update-Parameters", value).