T - The type of the expected response.public interface HttpRequest<T>
| Modifier and Type | Method and Description |
|---|---|
HeaderList |
headers()
Returns a
HeaderList containing the Headers to send with the request. |
HttpMethod |
method()
Returns the HTTP method of this request.
|
HttpRequestEntity |
requestEntity()
Returns an
HttpRequestEntity that contains the body of this request. |
HttpResponseHandler<T> |
responseHandler(HttpResponse response)
Returns a handler for the response.
|
HttpMethod method()
HttpMethod this request uses.HeaderList headers()
HeaderList containing the Headers to send with the request. Requests that don't need to send any headers should return
EmptyHeaderList.INSTANCE.HeaderList, never null.HttpRequestEntity requestEntity()
HttpRequestEntity that contains the body of this request. If the request doesn't have any message body (like in case of a
HttpMethod.GET or an HttpMethods#OPTIONS request) this method should return EmptyHttpRequestEntity.INSTANCE.HttpRequestEntity object.HttpResponseHandler<T> responseHandler(HttpResponse response) throws java.io.IOException, ProtocolError, ProtocolException
response - The HttpResponse that needs to be handled.HttpResponseHandler.java.io.IOExceptionProtocolError - If the response is an error response as specified by the application protocol.ProtocolException - If the response is invalid or malformed and can not be handled properly.