mockwebserver / okhttp3.mockwebserver / RecordedRequest

RecordedRequest

class RecordedRequest

An HTTP request that came into the mock web server.

Constructors

Name Summary
<init> An HTTP request that came into the mock web server.RecordedRequest(requestLine:String, headers: Headers, chunkSizes:List<Int>, bodySize:Long, body:Buffer, sequenceNumber:Int, socket:Socket, failure:IOException? = null)

Properties

Name Summary
body The body of this POST request. This may be truncated.val body:Buffer
bodySize The total size of the body of this POST request (before truncation).val bodySize:Long
chunkSizes The sizes of the chunks of this request’s body, or an empty list if the request’s body was empty or unchunked.val chunkSizes:List<Int>
failure The failure MockWebServer recorded when attempting to decode this request. If, for example, the inbound request was truncated, this exception will be non-null.val failure:IOException?
handshake The TLS handshake of the connection that carried this request, or null if the request was received without TLS.val handshake: Handshake?
headers All headers.val headers: Headers
method val method:String?
path val path:String?
requestLine val requestLine:String
requestUrl val requestUrl: HttpUrl?
sequenceNumber 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.val sequenceNumber:Int
tlsVersion Returns the connection’s TLS version or null if the connection doesn’t use SSL.val tlsVersion: TlsVersion?

Functions

Name Summary
getHeader Returns the first header named name, or null if no such header exists.fun getHeader(name:String):String?
toString fun toString():String