public final class HttpResponse extends Object implements AutoCloseable
An HttpResponse
instance is built through an HttpResponse.Builder
.
This class provides methods for accessing the response status code, headers and the response body.
Modifier and Type | Class and Description |
---|---|
static class |
HttpResponse.Builder
Builder for the HttpResponse class. |
Constructor and Description |
---|
HttpResponse(HttpResponse other) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
DataEntity |
getBody()
Returns the body of this response.
|
List<HttpHeader> |
getHeaders()
Returns the received response headers.
|
int |
getStatusCode()
Returns the status code for this response.
|
static HttpResponse.Builder |
newBuilder()
Returns the new
HttpResponse builder. |
public HttpResponse(@NotNull HttpResponse other)
public void close()
close
in interface AutoCloseable
@NotNull public static HttpResponse.Builder newBuilder()
HttpResponse
builder.HttpResponse
builder.@Nullable public DataEntity getBody()
@NotNull public List<HttpHeader> getHeaders()
public int getStatusCode()