public final class Response extends Object implements Closeable
This class implements Closeable. Closing it simply closes its response body. See
ResponseBody for an explanation and examples.
| Modifier and Type | Class and Description |
|---|---|
static class |
Response.Builder |
| Modifier and Type | Method and Description |
|---|---|
ResponseBody |
body() |
CacheControl |
cacheControl() |
Response |
cacheResponse() |
List<Challenge> |
challenges() |
void |
close() |
int |
code() |
Handshake |
handshake() |
String |
header(String name) |
String |
header(String name,
String defaultValue) |
Headers |
headers() |
List<String> |
headers(String name) |
boolean |
isRedirect() |
boolean |
isSuccessful() |
String |
message() |
Response |
networkResponse() |
Response.Builder |
newBuilder() |
ResponseBody |
peekBody(long byteCount) |
Response |
priorResponse() |
Protocol |
protocol() |
long |
receivedResponseAtMillis() |
Request |
request() |
long |
sentRequestAtMillis() |
String |
toString() |
public Request request()
public Protocol protocol()
public int code()
public boolean isSuccessful()
public String message()
public Handshake handshake()
public Headers headers()
public ResponseBody peekBody(long byteCount) throws IOException
IOExceptionpublic ResponseBody body()
public Response.Builder newBuilder()
public boolean isRedirect()
public Response networkResponse()
public Response cacheResponse()
public Response priorResponse()
public CacheControl cacheControl()
public long sentRequestAtMillis()
public long receivedResponseAtMillis()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2019. All rights reserved.