class HttpResponse
source · line 11public class HttpResponse internal constructor(internal val call: ClientCall,
/**
* The final response or accepted handshake head.
*/
public val head: HttpResponseHead) : AsyncCloseable
- Supertype
AsyncCloseable
Final response headers plus a single-consumer body. Non-2xx responses are ordinary values until requireSuccess is called; the caller must close the response.
function requireSuccess
source · line 73public fun requireSuccess(): HttpResponse
Returns this response for status 200..299; otherwise throws HttpStatusException without replacing the caller's close responsibility.
property fields
source · line 27public val fields: Array<HttpField>
get: public read-only
Ordered response fields, retaining original content-coding metadata.
getter get
source · line 27get(): Array<HttpField>
property cacheStatus
source · line 51public val cacheStatus: HttpCacheStatus
get: public read-only
Whether this response came from network, cache, or validation.
function close
source · line 81public override suspend fun close(): Unit
- Overrides
close
Closes the body and awaits call cleanup, releasing or retiring the underlying connection/stream.
property retryCount
source · line 39public val retryCount: Long
get: public read-only
The number of retries before this result.
property trailers
source · line 68public val trailers: Array<HttpField>?
get: public read-only
Complete trailers after successful body completion, or None while incomplete.
getter get
source · line 68get(): Option<Array<HttpField>>
property proxyAuthenticationCount
source · line 47public val proxyAuthenticationCount: Long
get: public read-only
The number of proxy authentication retries before this result.
property wireContentLength
source · line 59public val wireContentLength: Long?
get: public read-only
Content-Length from the wire headers, which is not necessarily the decoded body length.
property version
source · line 19public val version: HttpVersion
get: public read-only
The final response protocol version.
getter get
source · line 19get(): HttpVersion
property body
source · line 64public val body: HttpResponseBody
get: public read-only
The single forward-only response-body cursor.
property head
source · line 15public val head: HttpResponseHead
get: public read-only
The final response or accepted handshake head.
property status
source · line 23public val status: UInt
get: public read-only
The final status code.
getter get
source · line 23get(): UInt
property metrics
source · line 55public val metrics: HttpAttemptMetrics?
get: public read-only
The latest optional attempt-metrics snapshot.
getter get
source · line 55get(): Option<HttpAttemptMetrics>
property url
source · line 31public val url: Url
get: public read-only
The final URL after redirects.
getter get
source · line 31get(): Url
property redirectHistory
source · line 35public val redirectHistory: Array<HttpRedirect>
get: public read-only
Completed redirect steps in order.
property authenticationCount
source · line 43public val authenticationCount: Long
get: public read-only
The number of origin authentication retries before this result.