T - The generic type of the wrapped request.public final class BufferedRequest<T> extends java.lang.Object implements HttpRequest<T>
| Constructor and Description |
|---|
BufferedRequest(HttpRequest<T> request)
Creates a
BufferedRequest wrapper for the given request with an "unlimited" buffer size. |
BufferedRequest(HttpRequest<T> request,
int maxBufferSize)
Creates a
BufferedRequest wrapper for the given request using the given maximum buffer size. |
| 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.
|
public BufferedRequest(HttpRequest<T> request)
BufferedRequest wrapper for the given request with an "unlimited" buffer size.request - The request to buffer.public BufferedRequest(HttpRequest<T> request, int maxBufferSize)
BufferedRequest wrapper for the given request using the given maximum buffer size.request - The request to buffer.maxBufferSize - The maximum buffer size.public HttpMethod method()
HttpRequestmethod in interface HttpRequest<T>HttpMethod this request uses.public HeaderList headers()
HttpRequestHeaderList containing the Headers to send with the request. Requests that don't need to send any headers should return
EmptyHeaderList.INSTANCE.headers in interface HttpRequest<T>HeaderList, never null.public HttpRequestEntity requestEntity()
HttpRequestHttpRequestEntity 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.requestEntity in interface HttpRequest<T>HttpRequestEntity object.public HttpResponseHandler<T> responseHandler(HttpResponse response) throws java.io.IOException, ProtocolError, ProtocolException
HttpRequestresponseHandler in interface HttpRequest<T>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.