class OkHttp3ClientHttpResponse extends AbstractClientHttpResponse
ClientHttpResponse
implementation based on OkHttp 3.x.Modifier and Type | Field and Description |
---|---|
private HttpHeaders |
headers |
private Response |
response |
Constructor and Description |
---|
OkHttp3ClientHttpResponse(Response response) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this response, freeing any resources created.
|
java.io.InputStream |
getBody()
Return the body of the message as an input stream.
|
HttpHeaders |
getHeaders()
Return the headers of this message.
|
int |
getRawStatusCode()
Return the HTTP status code (potentially non-standard and not
resolvable through the
HttpStatus enum) as an integer. |
java.lang.String |
getStatusText()
Return the HTTP status text of the response.
|
getStatusCode
private final Response response
@Nullable private volatile HttpHeaders headers
public int getRawStatusCode()
ClientHttpResponse
HttpStatus
enum) as an integer.ClientHttpResponse.getStatusCode()
,
HttpStatus.resolve(int)
public java.lang.String getStatusText()
ClientHttpResponse
public java.io.InputStream getBody() throws java.io.IOException
HttpInputMessage
null
)java.io.IOException
- in case of I/O Errorspublic HttpHeaders getHeaders()
HttpMessage
null
)public void close()
ClientHttpResponse