public class HttpRequestWrapper extends org.apache.http.message.AbstractHttpMessage implements HttpUriRequest
HttpRequest
that can be used to change properties of the current
request without modifying the original object.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. |
org.apache.http.HttpRequest |
getOriginal() |
org.apache.http.params.HttpParams |
getParams()
Deprecated.
(4.3) use
RequestConfig . |
org.apache.http.ProtocolVersion |
getProtocolVersion() |
org.apache.http.RequestLine |
getRequestLine() |
org.apache.http.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(org.apache.http.ProtocolVersion version) |
void |
setURI(URI uri) |
String |
toString() |
static HttpRequestWrapper |
wrap(org.apache.http.HttpRequest request)
Creates a mutable wrapper of the original request.
|
static HttpRequestWrapper |
wrap(org.apache.http.HttpRequest request,
org.apache.http.HttpHost target)
Creates a mutable wrapper of the original request.
|
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
public org.apache.http.ProtocolVersion getProtocolVersion()
getProtocolVersion
in interface org.apache.http.HttpMessage
public void setProtocolVersion(org.apache.http.ProtocolVersion version)
public URI getURI()
HttpUriRequest
http://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 HttpUriRequest
public void setURI(URI uri)
public String getMethod()
HttpUriRequest
GET
,
PUT
, POST
, or other.getMethod
in interface HttpUriRequest
public void abort() throws UnsupportedOperationException
HttpUriRequest
abort
in interface HttpUriRequest
UnsupportedOperationException
- if the abort operation
is not supported / cannot be implemented.public boolean isAborted()
HttpUriRequest
isAborted
in interface HttpUriRequest
true
if the request execution has been aborted,
false
otherwise.public org.apache.http.RequestLine getRequestLine()
getRequestLine
in interface org.apache.http.HttpRequest
public org.apache.http.HttpRequest getOriginal()
public org.apache.http.HttpHost getTarget()
public static HttpRequestWrapper wrap(org.apache.http.HttpRequest request)
request
- original requestpublic static HttpRequestWrapper wrap(org.apache.http.HttpRequest request, org.apache.http.HttpHost target)
request
- original requesttarget
- original target, if explicitly specified@Deprecated public org.apache.http.params.HttpParams getParams()
RequestConfig
.getParams
in interface org.apache.http.HttpMessage
getParams
in class org.apache.http.message.AbstractHttpMessage
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.