enqueue

fun MockWebServer.enqueue(fixture: Fixture, method: HttpMethod = HttpMethod.Get)(source)

Queues fixture, written by toMockResponse, on this server's default queue dispatcher.

Stable Core, source compatibility only. A server whose dispatcher was replaced (a scripted mockwebserver3.Dispatcher) is refused: the custom dispatcher decides its own responses, and it may call toMockResponse itself.

Parameters

fixture

the response to queue.

method

the request method it answers; GET by default.

Throws

if the server's dispatcher is not the default QueueDispatcher.