Scoop API

scoop:scoop.http.client:0.1.0

HttpResponse

class HttpResponse

source · line 11
public
public class HttpResponse internal constructor(internal val call: ClientCall,
    /**
     * The final response or accepted handshake head.
     */
    public val head: HttpResponseHead) : 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 73
public
public fun requireSuccess(): HttpResponse

Returns this response for status 200..299; otherwise throws HttpStatusException without replacing the caller's close responsibility.

property cacheStatus

source · line 51
public
public val cacheStatus: HttpCacheStatus

get: public read-only

Whether this response came from network, cache, or validation.

function close

source · line 81
public
public override suspend fun close(): Unit

Closes the body and awaits call cleanup, releasing or retiring the underlying connection/stream.

property retryCount

source · line 39
public
public val retryCount: Long

get: public read-only

The number of retries before this result.

property proxyAuthenticationCount

source · line 47
public
public val proxyAuthenticationCount: Long

get: public read-only

The number of proxy authentication retries before this result.

property wireContentLength

source · line 59
public
public val wireContentLength: Long?

get: public read-only

Content-Length from the wire headers, which is not necessarily the decoded body length.

property authenticationCount

source · line 43
public
public val authenticationCount: Long

get: public read-only

The number of origin authentication retries before this result.