CIOHeaders

class CIOHeaders : Headers

An adapter from CIO low-level headers map to ktor Headers interface

Constructors

<init>

CIOHeaders(headers: HttpHeadersMap)

An adapter from CIO low-level headers map to ktor Headers interface

Properties

caseInsensitiveName

val caseInsensitiveName: Boolean

Specifies if map has case-sensitive or case-insensitive names

Functions

entries

fun entries(): Set<Entry<String, List<String>>>

Gets all entries from the map

get

fun get(name: String): String?

Gets first value from the list of values associated with a name, or null if the name is not present

getAll

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

Gets all values associated with the name, or null if the name is not present

isEmpty

fun isEmpty(): Boolean

Checks if this map is empty

names

fun names(): Set<String>

Gets all names from the map

Extension Functions

filter

fun StringValues.filter(
    keepEmpty: Boolean = false,
    predicate: (String, String) -> Boolean
): StringValues

Create a new instance of StringValues filtered by the specified predicate

flattenEntries

fun StringValues.flattenEntries(): List<Pair<String, String>>

Copy values to a list of pairs

flattenForEach

fun StringValues.flattenForEach(
    block: (String, String) -> Unit
): Unit

Invoke block function for every value pair

parseVersions

fun Headers.parseVersions(): List<Version>

Retrieves LastModified and ETag versions from headers.

toMap

fun StringValues.toMap(): Map<String, List<String>>

Copy values to a new independent map