Skip to content

//readium-shared/org.readium.r2.shared.util.http/HttpRequest

HttpRequest

[androidJvm]\ class HttpRequest(val url: String, val method: HttpRequest.Method = Method.GET, val headers: Map<String, 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

androidJvm

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

HttpRequest [androidJvm]
fun HttpRequest(url: String, method: HttpRequest.Method = Method.GET, headers: Map<String, String> = mapOf(), body: HttpRequest.Body? = null, extras: Bundle = Bundle(), connectTimeout: Duration? = null, readTimeout: Duration? = null, allowUserInteraction: Boolean = false)

Types

Name Summary
Body [androidJvm]
sealed class Body : Serializable
Supported body values.
Builder [androidJvm]
class Builder(url: String, var method: HttpRequest.Method = Method.GET, var headers: MutableMap<String, String> = mutableMapOf(), var body: HttpRequest.Body? = null, var extras: Bundle = Bundle(), var connectTimeout: Duration? = null, var readTimeout: Duration? = null, var allowUserInteraction: Boolean = false)
Companion [androidJvm]
object Companion
Method [androidJvm]
enum Method : Enum<HttpRequest.Method> , Serializable
Supported HTTP methods.

Functions

Name Summary
buildUpon [androidJvm]
fun buildUpon(): HttpRequest.Builder

Properties

Name Summary
allowUserInteraction [androidJvm]
val allowUserInteraction: Boolean = false
body [androidJvm]
val body: HttpRequest.Body? = null
connectTimeout [androidJvm]
val connectTimeout: Duration? = null
extras [androidJvm]
val extras: Bundle
headers [androidJvm]
val headers: Map<String, String>
method [androidJvm]
val method: HttpRequest.Method
readTimeout [androidJvm]
val readTimeout: Duration? = null
url [androidJvm]
val url: String