mockwebserver / okhttp3.mockwebserver / RecordedRequest

RecordedRequest

class RecordedRequest

An HTTP request that came into the mock web server.

Constructors

<init>

RecordedRequest(requestLine: String, headers: Headers, chunkSizes: List<Int>, bodySize: Long, body: Buffer, sequenceNumber: Int, socket: Socket)

An HTTP request that came into the mock web server.

Properties

body

val body: Buffer

The body of this POST request. This may be truncated.

bodySize

val bodySize: Long

The total size of the body of this POST request (before truncation).

chunkSizes

val chunkSizes: List<Int>

The sizes of the chunks of this request's body, or an empty list if the request's body was empty or unchunked.

handshake

val handshake: Handshake?

The TLS handshake of the connection that carried this request, or null if the request was received without TLS.

headers

val headers: Headers

All headers.

method

val method: String?

path

val path: String?

requestLine

val requestLine: String

requestUrl

val requestUrl: HttpUrl?

sequenceNumber

val sequenceNumber: Int

The index of this request on its HTTP connection. Since a single HTTP connection may serve multiple requests, each request is assigned its own sequence number.

tlsVersion

val tlsVersion: TlsVersion?

Returns the connection's TLS version or null if the connection doesn't use SSL.

utf8Body

val utf8Body: String

Functions

getHeader

fun getHeader(name: String): String?

Returns the first header named name, or null if no such header exists.

toString

fun toString(): String