Build 1.0_r1(from source)

org.apache.http.client.methods
Class HttpRequestBase

java.lang.Object
  extended by org.apache.http.message.AbstractHttpMessage
      extended by 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

Field Summary
 
Fields inherited from class org.apache.http.message.AbstractHttpMessage
headergroup, params
 
Constructor Summary
HttpRequestBase()
           
 
Method Summary
 void abort()
          Aborts execution of the request.
 Object clone()
          Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
abstract  String getMethod()
          Returns the HTTP method this request uses, such as GET, PUT, POST, or other.
 ProtocolVersion getProtocolVersion()
          Returns the protocol version this message is compatible with.
 RequestLine getRequestLine()
          Returns the request line of this request.
 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 setConnectionRequest(ClientConnectionRequest connRequest)
          Sets the ClientConnectionRequest callback that can be used to abort a long-lived request for a connection.
 void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger)
          Sets the ConnectionReleaseTrigger callback that can be used to abort an active connection.
 void setURI(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, setParams
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.http.HttpMessage
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
 

Constructor Detail

HttpRequestBase

public HttpRequestBase()
Method Detail

getMethod

public abstract String getMethod()
Description copied from interface: HttpUriRequest
Returns the HTTP method this request uses, such as GET, PUT, POST, or other.

Specified by:
getMethod in interface HttpUriRequest

getProtocolVersion

public ProtocolVersion getProtocolVersion()
Description copied from interface: HttpMessage
Returns the protocol version this message is compatible with.

Specified by:
getProtocolVersion in interface HttpMessage

getURI

public URI getURI()
Description copied from interface: HttpUriRequest
Returns the URI this request uses, such as http://example.org/path/to/file.

Specified by:
getURI in interface HttpUriRequest

getRequestLine

public RequestLine getRequestLine()
Description copied from interface: HttpRequest
Returns the request line of this request.

Specified by:
getRequestLine in interface HttpRequest
Returns:
the request line.

setURI

public void setURI(URI uri)

setConnectionRequest

public void setConnectionRequest(ClientConnectionRequest connRequest)
                          throws IOException
Description copied from interface: AbortableHttpRequest
Sets the ClientConnectionRequest callback that can be used to abort a long-lived request for a connection. If the request is already aborted, throws an IOException.

Specified by:
setConnectionRequest in interface AbortableHttpRequest
Throws:
IOException
See Also:
ClientConnectionManager, ThreadSafeClientConnManager

setReleaseTrigger

public void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger)
                       throws IOException
Description copied from interface: AbortableHttpRequest
Sets the ConnectionReleaseTrigger callback that can be used to abort an active connection. Typically, this will be the ManagedClientConnection itself. If the request is already aborted, throws an IOException.

Specified by:
setReleaseTrigger in interface AbortableHttpRequest
Throws:
IOException

abort

public void abort()
Description copied from interface: HttpUriRequest
Aborts execution of the request.

Specified by:
abort in interface AbortableHttpRequest
Specified by:
abort in interface HttpUriRequest
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: HttpUriRequest
Tests if the request execution has been aborted.

Specified by:
isAborted in interface HttpUriRequest
Returns:
true if the request execution has been aborted, false otherwise.

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: Object
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.

Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.

Overrides:
clone in class Object
Returns:
Object a shallow copy of this object.
Throws:
CloneNotSupportedException - if the receiver's class does not implement the interface Cloneable.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature