mockwebserver / okhttp3.mockwebserver / MockWebServer / dispatcher

dispatcher

var dispatcher: Dispatcher

Returns the dispatcher used to respond to HTTP requests. The default dispatcher is a QueueDispatcher but other dispatchers can be configured.

Sets the dispatcher used to match incoming requests to mock responses. The default dispatcher simply serves a fixed sequence of responses from a queue; custom dispatchers can vary the response based on timing or the content of the request.