A scriptable web server for testing HTTP clients.

All Types

okhttp3.mockwebserver.Dispatcher

Handler for mock server requests.

okhttp3.mockwebserver.internal.duplex.DuplexResponseBody
okhttp3.mockwebserver.internal.duplex.MockDuplexResponseBody

A scriptable request/response conversation. Create the script by calling methods like receiveRequest in the sequence they are run.

okhttp3.mockwebserver.MockResponse

A scripted response to be replayed by the mock web server.

okhttp3.mockwebserver.MockWebServer

A scriptable web server. Callers supply canned responses and the server replays them upon request in sequence.

okhttp3.mockwebserver.PushPromise

An HTTP request initiated by the server.

okhttp3.mockwebserver.QueueDispatcher

Default dispatcher that processes a script of responses. Populate the script by calling enqueueResponse.

okhttp3.mockwebserver.RecordedRequest

An HTTP request that came into the mock web server.

okhttp3.mockwebserver.SocketPolicy

What should be done with the incoming socket.