final class HttpComponentsClientHttpResponse extends AbstractClientHttpResponse
ClientHttpResponse
implementation based on
Apache HttpComponents HttpClient.
Created via the HttpComponentsClientHttpRequest
.
AbstractClientHttpRequest.execute()
Modifier and Type | Field and Description |
---|---|
private HttpHeaders |
headers |
private HttpResponse |
httpResponse |
Constructor and Description |
---|
HttpComponentsClientHttpResponse(HttpResponse httpResponse) |
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 HttpResponse httpResponse
@Nullable private HttpHeaders headers
HttpComponentsClientHttpResponse(HttpResponse httpResponse)
public int getRawStatusCode() throws java.io.IOException
ClientHttpResponse
HttpStatus
enum) as an integer.java.io.IOException
- in case of I/O errorsClientHttpResponse.getStatusCode()
,
HttpStatus.resolve(int)
public java.lang.String getStatusText() throws java.io.IOException
ClientHttpResponse
java.io.IOException
- in case of I/O errorspublic HttpHeaders getHeaders()
HttpMessage
null
)public java.io.InputStream getBody() throws java.io.IOException
HttpInputMessage
null
)java.io.IOException
- in case of I/O Errorspublic void close()
ClientHttpResponse