public interface ClientHttpResponse extends HttpInputMessage, java.io.Closeable
ClientHttpRequest.execute()
.
A ClientHttpResponse
must be closed,
typically in a finally
block.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this response, freeing any resources created.
|
int |
getRawStatusCode()
Return the HTTP status code (potentially non-standard and not
resolvable through the
HttpStatus enum) as an integer. |
HttpStatus |
getStatusCode()
Return the HTTP status code of the response.
|
java.lang.String |
getStatusText()
Return the HTTP status text of the response.
|
getBody
getHeaders
HttpStatus getStatusCode() throws java.io.IOException
java.io.IOException
- in case of I/O errorsjava.lang.IllegalArgumentException
- in case of an unknown HTTP status codeHttpStatus.valueOf(int)
int getRawStatusCode() throws java.io.IOException
HttpStatus
enum) as an integer.java.io.IOException
- in case of I/O errorsgetStatusCode()
java.lang.String getStatusText() throws java.io.IOException
java.io.IOException
- in case of I/O errorsvoid close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable