RecordedRequest

class RecordedRequest(val requestLine: String, val headers: Headers, val chunkSizes: List<Int>, val bodySize: Long, val body: Buffer, val sequenceNumber: Int, socket: Socket, val failure: IOException? = null)

An HTTP request that came into the mock web server.

Constructors

Link copied to clipboard
constructor(requestLine: String, headers: Headers, chunkSizes: List<Int>, bodySize: Long, body: Buffer, sequenceNumber: Int, socket: Socket, failure: IOException? = null)

Properties

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
val failure: IOException? = null

The failure MockWebServer recorded when attempting to decode this request. If, for example, the inbound request was truncated, this exception will be non-null.

Link copied to clipboard

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

Link copied to clipboard

Returns the name of the server the client requested via the SNI (Server Name Indication) attribute in the TLS handshake. Unlike the rest of the HTTP exchange, this name is sent in cleartext and may be monitored or blocked by a proxy or other middlebox.

Link copied to clipboard

All headers.

Link copied to clipboard
Link copied to clipboard
val path: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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.

Functions

Link copied to clipboard
open override fun toString(): String