data class Request
(source)
The Request data class represents a resource request to be send by a Client.
It's API is inspired by the Request interface of the Web Fetch API: https://developer.mozilla.org/en-US/docs/Web/API/Request
class Body : Closeable
|
|
enum class Method
Request methods. |
|
enum class Redirect |
Request(url: String, method: Method = Method.GET, headers: MutableHeaders? = MutableHeaders(), connectTimeout: Pair<Long, TimeUnit>? = null, readTimeout: Pair<Long, TimeUnit>? = null, body: Body? = null, redirect: Redirect = Redirect.FOLLOW)
The Request data class represents a resource request to be send by a Client. |
val body: Body?
An optional body to be send with the request. |
|
val connectTimeout: Pair<Long, TimeUnit>?
A timeout to be used when connecting to the resource. If the timeout expires before the connection can be established, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout. |
|
val headers: MutableHeaders?
Optional HTTP headers to be send with the request. |
|
val method: Method
The request method (GET, POST, ..) |
|
val readTimeout: Pair<Long, TimeUnit>?
A timeout to be used when reading from the resource. If the timeout expires before there is data available for read, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout. |
|
val redirect: Redirect
Whether the Client should follow redirects (HTTP 3xx) for this request or not. |
|
val url: String
The URL of the request. |