HttpRequest

class HttpRequest(val url: AbsoluteUrl, val method: HttpRequest.Method = Method.GET, val headers: Map<String, List<String>> = mapOf(), val body: HttpRequest.Body? = null, val extras: Bundle = Bundle(), val connectTimeout: Duration? = null, val readTimeout: Duration? = null, val allowUserInteraction: Boolean = false) : Serializable

Holds the information about an HTTP request performed by an HttpClient.

Parameters

url

Address of the remote resource to request.

method

HTTP method to use for the request.

headers

Additional HTTP headers to use.

body

Content put in the body of the HTTP request.

extras

Bundle of additional information, which might be used by a specific implementation of HTTPClient.

connectTimeout

Timeout used when establishing a connection to the resource. A null timeout is interpreted as the default value, while a timeout of zero as an infinite timeout.

readTimeout

Timeout used when reading the input stream. A null timeout is interpreted as the default value, while a timeout of zero as an infinite timeout.

allowUserInteraction

If true, the user might be presented with interactive dialogs, such as popping up an authentication dialog.

Constructors

Link copied to clipboard
constructor(url: AbsoluteUrl, method: HttpRequest.Method = Method.GET, headers: Map<String, List<String>> = mapOf(), body: HttpRequest.Body? = null, extras: Bundle = Bundle(), connectTimeout: Duration? = null, readTimeout: Duration? = null, allowUserInteraction: Boolean = false)

Types

Link copied to clipboard
sealed class Body : Serializable

Supported body values.

Link copied to clipboard
class Builder(val url: AbsoluteUrl, var method: HttpRequest.Method = Method.GET, var headers: MutableMap<String, MutableList<String>> = mutableMapOf(), var body: HttpRequest.Body? = null, var extras: Bundle = Bundle(), var connectTimeout: Duration? = null, var readTimeout: Duration? = null, var allowUserInteraction: Boolean = false)
Link copied to clipboard
object Companion
Link copied to clipboard

Supported HTTP methods.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard