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:
java.lang.Cloneable, AbortableHttpRequest, HttpUriRequest, org.apache.http.HttpMessage, org.apache.http.HttpRequest
Direct Known Subclasses:
HttpDelete, HttpEntityEnclosingRequestBase, HttpGet, HttpHead, HttpOptions, HttpTrace

@NotThreadSafe
public abstract class HttpRequestBase
extends org.apache.http.message.AbstractHttpMessage
implements HttpUriRequest, AbortableHttpRequest, java.lang.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.
 java.lang.Object clone()
           
abstract  java.lang.String getMethod()
          Returns the HTTP method this request uses, such as GET, PUT, POST, or other.
 org.apache.http.ProtocolVersion getProtocolVersion()
           
 org.apache.http.RequestLine getRequestLine()
           
 java.net.URI getURI()
          Returns the original request URI.
 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(java.net.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 java.lang.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 org.apache.http.ProtocolVersion getProtocolVersion()
Specified by:
getProtocolVersion in interface org.apache.http.HttpMessage

getURI

public java.net.URI getURI()
Returns the original request URI.

Please note URI remains unchanged in the course of request execution and is not updated if the request is redirected to another location.

Specified by:
getURI in interface HttpUriRequest

getRequestLine

public org.apache.http.RequestLine getRequestLine()
Specified by:
getRequestLine in interface org.apache.http.HttpRequest

setURI

public void setURI(java.net.URI uri)

setConnectionRequest

public void setConnectionRequest(ClientConnectionRequest connRequest)
                          throws java.io.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:
java.io.IOException
See Also:
ClientConnectionManager, ThreadSafeClientConnManager

setReleaseTrigger

public void setReleaseTrigger(ConnectionReleaseTrigger releaseTrigger)
                       throws java.io.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:
java.io.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 java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.