Package org.apache.http.impl.client
Class RequestWrapper
java.lang.Object
org.apache.http.message.AbstractHttpMessage
org.apache.http.impl.client.RequestWrapper
- All Implemented Interfaces:
HttpUriRequest,HttpMessage,HttpRequest
- Direct Known Subclasses:
EntityEnclosingRequestWrapper
public class RequestWrapper extends AbstractHttpMessage implements HttpUriRequest
A wrapper class for
HttpRequests that can be used to change
properties of the current request without modifying the original
object.
This class is also capable of resetting the request headers to
the state of the original request.- Since:
- 4.0
- Version:
- $Revision: 674186 $
- Author:
- Oleg Kalnichevski
-
Field Summary
Fields inherited from class org.apache.http.message.AbstractHttpMessage
headergroup, params -
Constructor Summary
Constructors Constructor Description RequestWrapper(HttpRequest request) -
Method Summary
Modifier and Type Method Description voidabort()Aborts execution of the request.intgetExecCount()StringgetMethod()Returns the HTTP method this request uses, such asGET,PUT,POST, or other.HttpRequestgetOriginal()ProtocolVersiongetProtocolVersion()Returns the protocol version this message is compatible with.RequestLinegetRequestLine()Returns the request line of this request.URIgetURI()Returns the URI this request uses, such ashttp://example.org/path/to/file.voidincrementExecCount()booleanisAborted()Tests if the request execution has been aborted.booleanisRepeatable()voidresetHeaders()voidsetMethod(String method)voidsetProtocolVersion(ProtocolVersion version)voidsetURI(URI uri)Methods inherited from class org.apache.http.message.AbstractHttpMessage
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParamsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.http.HttpMessage
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
-
Constructor Details
-
RequestWrapper
- Throws:
ProtocolException
-
-
Method Details
-
resetHeaders
public void resetHeaders() -
getMethod
Description copied from interface:HttpUriRequestReturns the HTTP method this request uses, such asGET,PUT,POST, or other.- Specified by:
getMethodin interfaceHttpUriRequest
-
setMethod
-
getProtocolVersion
Description copied from interface:HttpMessageReturns the protocol version this message is compatible with.- Specified by:
getProtocolVersionin interfaceHttpMessage
-
setProtocolVersion
-
getURI
Description copied from interface:HttpUriRequestReturns the URI this request uses, such ashttp://example.org/path/to/file.- Specified by:
getURIin interfaceHttpUriRequest
-
setURI
-
getRequestLine
Description copied from interface:HttpRequestReturns the request line of this request.- Specified by:
getRequestLinein interfaceHttpRequest- Returns:
- the request line.
-
abort
Description copied from interface:HttpUriRequestAborts execution of the request.- Specified by:
abortin interfaceHttpUriRequest- Throws:
UnsupportedOperationException- if the abort operation is not supported / cannot be implemented.
-
isAborted
public boolean isAborted()Description copied from interface:HttpUriRequestTests if the request execution has been aborted.- Specified by:
isAbortedin interfaceHttpUriRequest- Returns:
trueif the request execution has been aborted,falseotherwise.
-
getOriginal
-
isRepeatable
public boolean isRepeatable() -
getExecCount
public int getExecCount() -
incrementExecCount
public void incrementExecCount()
-