HttpCookies

class HttpCookies

HttpClient feature that handles sent Cookie, and received Set-Cookie headers, using a specific storage for storing and retrieving cookies.

You can configure the Config.storage and to provide Config.default blocks to set cookies when installing.

Types

Companion

companion object Companion : 
    HttpClientFeature<Config, HttpCookies>

Config

class Config

Constructors

<init>

HttpCookies(storage: CookiesStorage)

HttpClient feature that handles sent Cookie, and received Set-Cookie headers, using a specific storage for storing and retrieving cookies.

Functions

get

suspend fun get(requestUrl: Url): List<Cookie>

Companion Object Properties

key

The AttributeKey for this feature.

Companion Object Functions

install

fun install(feature: HttpCookies, scope: HttpClient): Unit

Installs the feature class for a HttpClient defined at scope.

prepare

fun prepare(block: Config.() -> Unit): HttpCookies

Builds a TFeature by calling the block with a TConfig config instance as receiver.