| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.concurrent.BlockingQueue<MockResponse> |
QueueDispatcher.responseQueue |
| Modifier and Type | Method | Description |
|---|---|---|
MockResponse |
MockResponse.addHeader(java.lang.String header) |
Adds
header as an HTTP header. |
MockResponse |
MockResponse.addHeader(java.lang.String name,
java.lang.Object value) |
Adds a new header with the name and value.
|
MockResponse |
MockResponse.addHeaderLenient(java.lang.String name,
java.lang.Object value) |
Adds a new header with the name and value.
|
MockResponse |
MockResponse.clearHeaders() |
Removes all HTTP headers including any "Content-Length" and "Transfer-encoding" headers that
were added by default.
|
MockResponse |
MockResponse.clone() |
|
abstract MockResponse |
Dispatcher.dispatch(RecordedRequest request) |
Returns a response to satisfy
request. |
MockResponse |
QueueDispatcher.dispatch(RecordedRequest request) |
|
MockResponse |
Dispatcher.peek() |
Returns an early guess of the next response, used for policy on how an incoming request should
be received.
|
MockResponse |
QueueDispatcher.peek() |
|
MockResponse |
MockResponse.removeHeader(java.lang.String name) |
Removes all headers named
name. |
MockResponse |
PushPromise.response() |
|
MockResponse |
MockResponse.setBody(java.lang.String body) |
Sets the response body to the UTF-8 encoded bytes of
body. |
MockResponse |
MockResponse.setBody(okio.Buffer body) |
|
MockResponse |
MockResponse.setBodyDelay(long delay,
java.util.concurrent.TimeUnit unit) |
Set the delayed time of the response body to
delay. |
MockResponse |
MockResponse.setChunkedBody(java.lang.String body,
int maxChunkSize) |
Sets the response body to the UTF-8 encoded bytes of
body, chunked every
maxChunkSize bytes. |
MockResponse |
MockResponse.setChunkedBody(okio.Buffer body,
int maxChunkSize) |
Sets the response body to
body, chunked every maxChunkSize bytes. |
MockResponse |
MockResponse.setHeader(java.lang.String name,
java.lang.Object value) |
Removes all headers named
name, then adds a new header with the name and value. |
MockResponse |
MockResponse.setHeaders(okhttp3.Headers headers) |
Replaces all headers with those specified in
headers. |
MockResponse |
MockResponse.setHeadersDelay(long delay,
java.util.concurrent.TimeUnit unit) |
|
MockResponse |
MockResponse.setHttp2ErrorCode(int http2ErrorCode) |
Sets the HTTP/2 error code to be
returned when resetting the stream.
|
MockResponse |
MockResponse.setResponseCode(int code) |
|
MockResponse |
MockResponse.setSocketPolicy(SocketPolicy socketPolicy) |
|
MockResponse |
MockResponse.setStatus(java.lang.String status) |
|
MockResponse |
MockResponse.throttleBody(long bytesPerPeriod,
long period,
java.util.concurrent.TimeUnit unit) |
Throttles the request reader and response writer to sleep for the given period after each
series of
bytesPerPeriod bytes are transferred. |
MockResponse |
MockResponse.withPush(PushPromise promise) |
When
protocols include Protocol.HTTP_2, this attaches a pushed stream to this response. |
MockResponse |
MockResponse.withSettings(okhttp3.internal.http2.Settings settings) |
When protocols include HTTP/2, this pushes
settings before writing the response. |
MockResponse |
MockResponse.withWebSocketUpgrade(okhttp3.WebSocketListener listener) |
Attempts to perform a web socket upgrade on the connection.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
MockWebServer.enqueue(MockResponse response) |
Scripts
response to be returned to a request made in sequence. |
void |
QueueDispatcher.enqueueResponse(MockResponse response) |
|
void |
QueueDispatcher.setFailFast(MockResponse failFastResponse) |
| Constructor | Description |
|---|---|
PushPromise(java.lang.String method,
java.lang.String path,
okhttp3.Headers headers,
MockResponse response) |
Copyright © 2020. All rights reserved.