| Package | Description |
|---|---|
| okhttp3.mockwebserver | |
| okhttp3.sample | |
| okhttp3.slack |
| Modifier and Type | Field and Description |
|---|---|
protected BlockingQueue<MockResponse> |
QueueDispatcher.responseQueue |
| Modifier and Type | Method and Description |
|---|---|
MockResponse |
MockResponse.addHeader(String header)
Adds
header as an HTTP header. |
MockResponse |
MockResponse.addHeader(String name,
Object value)
Adds a new header with the name and value.
|
MockResponse |
MockResponse.addHeaderLenient(String name,
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() |
MockResponse |
QueueDispatcher.dispatch(RecordedRequest request) |
abstract MockResponse |
Dispatcher.dispatch(RecordedRequest request)
Returns a response to satisfy
request. |
MockResponse |
QueueDispatcher.peek() |
MockResponse |
Dispatcher.peek()
Returns an early guess of the next response, used for policy on how an incoming request should
be received.
|
MockResponse |
MockResponse.removeHeader(String name)
Removes all headers named
name. |
MockResponse |
PushPromise.response() |
MockResponse |
MockResponse.setBody(okio.Buffer body) |
MockResponse |
MockResponse.setBody(String body)
Sets the response body to the UTF-8 encoded bytes of
body. |
MockResponse |
MockResponse.setBodyDelay(long delay,
TimeUnit unit)
Set the delayed time of the response body to
delay. |
MockResponse |
MockResponse.setChunkedBody(okio.Buffer body,
int maxChunkSize)
Sets the response body to
body, chunked every maxChunkSize bytes. |
MockResponse |
MockResponse.setChunkedBody(String body,
int maxChunkSize)
Sets the response body to the UTF-8 encoded bytes of
body, chunked every maxChunkSize bytes. |
MockResponse |
MockResponse.setHeader(String name,
Object value)
Removes all headers named
name, then adds a new header with the name and value. |
MockResponse |
MockResponse.setHeaders(Headers headers)
Replaces all headers with those specified in
headers. |
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(String status) |
MockResponse |
MockResponse.throttleBody(long bytesPerPeriod,
long period,
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(Settings settings)
|
MockResponse |
MockResponse.withWebSocketUpgrade(WebSocketListener listener)
Attempts to perform a web socket upgrade on the connection.
|
| Modifier and Type | Method and 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 and Description |
|---|
PushPromise(String method,
String path,
Headers headers,
MockResponse response) |
| Modifier and Type | Method and Description |
|---|---|
MockResponse |
SampleServer.dispatch(RecordedRequest request) |
| Modifier and Type | Method and Description |
|---|---|
MockResponse |
OAuthSessionFactory.dispatch(RecordedRequest request)
When the browser hits the redirect URL, use the provided code to ask Slack for a session.
|
Copyright © 2017. All Rights Reserved.