Cookies

note

Cookies - 图1

This help topic is in development and will be updated in the future.

This feature keeps cookies between calls or forces specific cookies.

Installation

  1. val client = HttpClient() {
  2. install(HttpCookies) {
  3. // Will keep an in-memory map with all the cookies from previous requests.
  4. storage = AcceptAllCookiesStorage()
  5. // Will ignore Set-Cookie and will send the specified cookies.
  6. storage = ConstantCookiesStorage(Cookie("mycookie1", "value"), Cookie("mycookie2", "value"))
  7. }
  8. }
  9. client.cookies("mydomain.com")