NetworkResponse

class NetworkResponse(val request: NetworkRequest, val code: Int = 200, val requestMillis: Long = 0, val responseMillis: Long = 0, val headers: NetworkHeaders = NetworkHeaders.EMPTY, val body: NetworkResponseBody? = null, val delegate: Any? = null)

Represents an HTTP response.

Parameters

request

The NetworkRequest that was executed to create this response.

code

The HTTP response code.

requestMillis

Timestamp of when the request was launched.

responseMillis

Timestamp of when the response was received.

headers

The HTTP headers.

body

The HTTP response body.

delegate

The underlying response instance. If executed by OkHttp, this is okhttp3.Response. If executed by Ktor, this is io.ktor.client.statement.HttpResponse.

Constructors

Link copied to clipboard
constructor(request: NetworkRequest, code: Int = 200, requestMillis: Long = 0, responseMillis: Long = 0, headers: NetworkHeaders = NetworkHeaders.EMPTY, body: NetworkResponseBody? = null, delegate: Any? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val code: Int = 200
Link copied to clipboard
val delegate: Any? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun copy(request: NetworkRequest = this.request, code: Int = this.code, requestMillis: Long = this.requestMillis, responseMillis: Long = this.responseMillis, headers: NetworkHeaders = this.headers, body: NetworkResponseBody? = this.body, delegate: Any? = this.delegate): NetworkResponse