Request

class Request

An HTTP request. Instances of this class are immutable if their body is null or itself immutable.

Constructors

Link copied to clipboard
constructor(url: HttpUrl, headers: Headers = headersOf(), method: String = "", body: RequestBody? = null)

Constructs a new request.

Types

Link copied to clipboard
open class Builder

Properties

Link copied to clipboard
Link copied to clipboard

Returns the cache control directives for this response. This is never null, even if this response contains no Cache-Control header.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun header(name: String): String?
Link copied to clipboard
fun headers(name: String): List<String>
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> tag(): T?

Returns the tag attached with T as a key, or null if no tag is attached with that key.

fun <T> tag(type: <Error class: unknown class><out T>): T?
fun <T : Any> tag(type: KClass<T>): T?

Returns the tag attached with type as a key, or null if no tag is attached with that key.

Link copied to clipboard
open override fun toString(): String