ApiResponse

data class ApiResponse<Res, ResH>(val status: Int = 200, val body: Res, val headers: ResH, val cookies: List<Cookie> = emptyList())

A wrapper for the response body and its header(s).

Constructors

Link copied to clipboard
constructor(status: Int = 200, body: Res, headers: ResH, cookies: List<Cookie> = emptyList())
constructor(body: Res, headers: ResH, cookies: List<Cookie> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val body: Res
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val status: Int

Functions

Link copied to clipboard
context(_: Raise<Issue>)
operator fun <T> get(field: CookieField<T>): T

Gets a cookie from the response by its field.

Link copied to clipboard

Adds a cookie to the response.

Link copied to clipboard
fun withCookies(newCookies: List<Cookie>): ApiResponse<Res, ResH>
fun withCookies(vararg newCookies: Cookie): ApiResponse<Res, ResH>

Adds multiple cookies to the response.

Link copied to clipboard

Adds headers to the response.

Link copied to clipboard

Adds a status code to the response.