HttpHeaders

open class HttpHeaders(source)

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

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@NotNull
val empty: @NotNull HttpHeaders

Functions

Link copied to clipboard
open fun addAll(@NonNull @NotNull other: @NotNull 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
@NotNull
open fun concurrent(): @NotNull HttpHeaders
Return this headers object, configured to allow safe concurrent read/write access.
Link copied to clipboard
@NotNull
open fun copy(): @NotNull HttpHeaders
Return a copy of these headers.
Link copied to clipboard
open fun delete(@NonNull @NotNull name: @NotNull String): Boolean
For internal use only.
Link copied to clipboard
@NotNull
open fun emptyIfNull(@Nullable @Nullable headers: @Nullable HttpHeaders): @NotNull HttpHeaders
Construct an empty HttpHeaders if the headers parameter is null.
Link copied to clipboard
@NotNull
open fun entries(): @NotNull StringMap.EntryList
Return the header entries (name/value pairs).
Link copied to clipboard
open fun equals(@Nullable @Nullable other: @Nullable Any): Boolean
Compare this HttpHeaders keys/values with another HttpHeaders keys/values for equality.
Link copied to clipboard
@Nullable
open fun get(@NonNull @NotNull name: @NotNull String): @Nullable String
Return (nullable) The value of a header, or null if not found.
Link copied to clipboard
open fun has(@NonNull @NotNull name: @NotNull String): Boolean
Return true if a specified header exists.
Link copied to clipboard
open fun hashCode(): Int
Return a hash code for this HttpHeaders.
Link copied to clipboard
open fun isEmpty(): Boolean
Return true if this map is empty.
Link copied to clipboard
@NotNull
open fun keys(): @NotNull StringList
Return the header names.
Link copied to clipboard
open fun parse(@NonNull @NotNull text: @NotNull String, @Nullable @Nullable request: @Nullable HttpRequest)
For internal use only.
Link copied to clipboard
open fun remove(@NonNull @NotNull name: @NotNull String): Boolean
Remove the value of a header, if present.
Link copied to clipboard
open fun set(@NonNull @NotNull name: @NotNull String, @NonNull @NotNull value: @NotNull String)
Set the value of a header.
Link copied to clipboard
open fun size(): Int
Return the number of headers.
Link copied to clipboard
@NotNull
open fun sortedEntries(): @NotNull StringMap.EntryList
Return the header entries (name/value pairs) sorted by name (case insensitive).
Link copied to clipboard
@NotNull
open fun sortedKeys(): @NotNull StringList
Return the header names in sorted order.
Link copied to clipboard
@NotNull
open fun toString(): @NotNull String
Return headers as a JSON string.
Link copied to clipboard
@NotNull
open fun toStringLowerCaseKeys(): @NotNull String
Return headers as a JSON string, that the key field is lower case.
Link copied to clipboard
@NotNull
open fun with(@NonNull @NotNull name: @NotNull String, @NonNull @NotNull value: @NotNull String): @NotNull HttpHeaders
Set the value of a header.
Link copied to clipboard
@NotNull
open fun withClientCredentials(@NonNull @NotNull credentials: @NotNull StructureBase): @NotNull HttpHeaders
Equivalent to withData("X-Client-Credentials", value).
Link copied to clipboard
@NotNull
open fun withCreateParameters(@NonNull @NotNull parameters: @NotNull StructureBase): @NotNull HttpHeaders
Equivalent to withData("X-Create-Parameters", value).
Link copied to clipboard
@NotNull
open fun withData(@NonNull @NotNull header: @NotNull String, @Nullable @Nullable value: @Nullable Any): @NotNull HttpHeaders
Convert value to OData 4.
Link copied to clipboard
@NotNull
open fun withDeleteParameters(@NonNull @NotNull parameters: @NotNull StructureBase): @NotNull HttpHeaders
Equivalent to withData("X-Delete-Parameters", parameters).
Link copied to clipboard
@NotNull
open fun withUpdateParameters(@NonNull @NotNull parameters: @NotNull StructureBase): @NotNull HttpHeaders
Equivalent to withData("X-Update-Parameters", value).