Package org.apache.http.client.methods
Class HttpRequestBase
java.lang.Object
org.apache.http.message.AbstractHttpMessage
org.apache.http.client.methods.HttpRequestBase
- All Implemented Interfaces:
Cloneable,AbortableHttpRequest,HttpUriRequest,HttpMessage,HttpRequest
- Direct Known Subclasses:
HttpDelete,HttpEntityEnclosingRequestBase,HttpGet,HttpHead,HttpOptions,HttpTrace
public abstract class HttpRequestBase extends AbstractHttpMessage implements HttpUriRequest, AbortableHttpRequest, Cloneable
Basic implementation of an HTTP request that can be modified.
- 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 HttpRequestBase() -
Method Summary
Modifier and Type Method Description voidabort()Aborts execution of the request.Objectclone()Creates and returns a copy of thisObject.abstract StringgetMethod()Returns the HTTP method this request uses, such asGET,PUT,POST, or other.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.booleanisAborted()Tests if the request execution has been aborted.voidsetConnectionRequest(ClientConnectionRequest connRequest)Sets theClientConnectionRequestcallback that can be used to abort a long-lived request for a connection.voidsetReleaseTrigger(ConnectionReleaseTrigger releaseTrigger)Sets theConnectionReleaseTriggercallback that can be used to abort an active connection.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
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
-
HttpRequestBase
public HttpRequestBase()
-
-
Method Details
-
getMethod
Description copied from interface:HttpUriRequestReturns the HTTP method this request uses, such asGET,PUT,POST, or other.- Specified by:
getMethodin interfaceHttpUriRequest
-
getProtocolVersion
Description copied from interface:HttpMessageReturns the protocol version this message is compatible with.- Specified by:
getProtocolVersionin interfaceHttpMessage
-
getURI
Description copied from interface:HttpUriRequestReturns the URI this request uses, such ashttp://example.org/path/to/file.- Specified by:
getURIin interfaceHttpUriRequest
-
getRequestLine
Description copied from interface:HttpRequestReturns the request line of this request.- Specified by:
getRequestLinein interfaceHttpRequest- Returns:
- the request line.
-
setURI
-
setConnectionRequest
Description copied from interface:AbortableHttpRequestSets theClientConnectionRequestcallback that can be used to abort a long-lived request for a connection. If the request is already aborted, throws anIOException.- Specified by:
setConnectionRequestin interfaceAbortableHttpRequest- Throws:
IOException- See Also:
ClientConnectionManager,ThreadSafeClientConnManager
-
setReleaseTrigger
Description copied from interface:AbortableHttpRequestSets theConnectionReleaseTriggercallback that can be used to abort an active connection. Typically, this will be theManagedClientConnectionitself. If the request is already aborted, throws anIOException.- Specified by:
setReleaseTriggerin interfaceAbortableHttpRequest- Throws:
IOException
-
abort
public void abort()Description copied from interface:HttpUriRequestAborts execution of the request.- Specified by:
abortin interfaceAbortableHttpRequest- Specified by:
abortin interfaceHttpUriRequest- See Also:
HttpClient.execute(HttpUriRequest),HttpClient.execute(org.apache.http.HttpHost, org.apache.http.HttpRequest),HttpClient.execute(HttpUriRequest, org.apache.http.protocol.HttpContext),HttpClient.execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.protocol.HttpContext)
-
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.
-
clone
Description copied from class:ObjectCreates and returns a copy of thisObject. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should callsuper.clone()to create the new instance and then create deep copies of the nested, mutable objects.- Overrides:
clonein classObject- Returns:
- a copy of this object.
- Throws:
CloneNotSupportedException- if this object's class does not implement theCloneableinterface.
-