public class WebServerDispatcher
extends okhttp3.mockwebserver.Dispatcher
Dispatcher for MockWebServer that allows per-path
customisation of the static data served.| Modifier and Type | Class | Description |
|---|---|---|
static class |
WebServerDispatcher.Resource |
A resource served by
WebServerDispatcher. |
| Modifier and Type | Method | Description |
|---|---|---|
okhttp3.mockwebserver.MockResponse |
dispatch(okhttp3.mockwebserver.RecordedRequest request) |
|
static WebServerDispatcher |
forResources(Iterable<WebServerDispatcher.Resource> resources) |
Constructs a dispatcher that handles requests based the provided
WebServerDispatcher.Resource instances. |
public static WebServerDispatcher forResources(Iterable<WebServerDispatcher.Resource> resources)
WebServerDispatcher.Resource instances.public okhttp3.mockwebserver.MockResponse dispatch(okhttp3.mockwebserver.RecordedRequest request)
dispatch in class okhttp3.mockwebserver.Dispatcher