@NotThreadSafe public class HttpRequestWrapper extends AbstractHttpMessage implements HttpUriRequest
HttpRequest that can be used to change properties of the current
request without modifying the original object.headergroup, params| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Aborts execution of the request.
|
String |
getMethod()
Returns the HTTP method this request uses, such as
GET,
PUT, POST, or other. |
HttpRequest |
getOriginal() |
HttpParams |
getParams()
Deprecated.
(4.3) use
RequestConfig. |
ProtocolVersion |
getProtocolVersion() |
RequestLine |
getRequestLine() |
HttpHost |
getTarget() |
URI |
getURI()
Returns the URI this request uses, such as
http://example.org/path/to/file. |
boolean |
isAborted()
Tests if the request execution has been aborted.
|
void |
setProtocolVersion(ProtocolVersion version) |
void |
setURI(URI uri) |
String |
toString() |
static HttpRequestWrapper |
wrap(HttpRequest request)
Creates a mutable wrapper of the original request.
|
static HttpRequestWrapper |
wrap(HttpRequest request,
HttpHost target)
Creates a mutable wrapper of the original request.
|
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParamsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParamspublic ProtocolVersion getProtocolVersion()
getProtocolVersion in interface HttpMessagepublic void setProtocolVersion(ProtocolVersion version)
public URI getURI()
HttpUriRequesthttp://example.org/path/to/file.
Note that the URI may be absolute URI (as above) or may be a relative URI.
Implementations are encouraged to return the URI that was initially requested.
To find the final URI after any redirects have been processed, please see the section entitled HTTP execution context in the HttpClient Tutorial
getURI in interface HttpUriRequestpublic void setURI(URI uri)
public String getMethod()
HttpUriRequestGET,
PUT, POST, or other.getMethod in interface HttpUriRequestpublic void abort()
throws UnsupportedOperationException
HttpUriRequestabort in interface HttpUriRequestUnsupportedOperationException - if the abort operation
is not supported / cannot be implemented.public boolean isAborted()
HttpUriRequestisAborted in interface HttpUriRequesttrue if the request execution has been aborted,
false otherwise.public RequestLine getRequestLine()
getRequestLine in interface HttpRequestpublic HttpRequest getOriginal()
public HttpHost getTarget()
public static HttpRequestWrapper wrap(HttpRequest request)
request - original requestpublic static HttpRequestWrapper wrap(HttpRequest request, HttpHost target)
request - original requesttarget - original target, if explicitly specified@Deprecated public HttpParams getParams()
RequestConfig.getParams in interface HttpMessagegetParams in class AbstractHttpMessageCopyright © 1999–2015 The Apache Software Foundation. All rights reserved.