public abstract class

HttpRequestBase

extends AbstractHttpMessage
implements Cloneable AbortableHttpRequest HttpUriRequest
java.lang.Object
   ↳ org.apache.http.message.AbstractHttpMessage
     ↳ org.apache.http.client.methods.HttpRequestBase
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Basic implementation of an HTTP request that can be modified.

Summary

[Expand]
Inherited Fields
From class org.apache.http.message.AbstractHttpMessage
Public Constructors
HttpRequestBase()
Public Methods
void abort()
Aborts this http request.
Object clone()
Creates and returns a copy of this Object.
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)
[Expand]
Inherited Methods
From class org.apache.http.message.AbstractHttpMessage
From class java.lang.Object
From interface org.apache.http.HttpMessage
From interface org.apache.http.HttpRequest
From interface org.apache.http.client.methods.AbortableHttpRequest
From interface org.apache.http.client.methods.HttpUriRequest

Public Constructors

public HttpRequestBase ()

Public Methods

public void abort ()

Aborts this http request. Any active execution of this method should return immediately. If the request has not started, it will abort after the next execution. Aborting this request will cause all subsequent executions with this request to fail.

public Object clone ()

Creates and returns a copy of this Object. 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 call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.

Returns
  • a copy of this object.

public abstract String getMethod ()

Returns the HTTP method this request uses, such as GET, PUT, POST, or other.

public ProtocolVersion getProtocolVersion ()

Returns the protocol version this message is compatible with.

public RequestLine getRequestLine ()

Returns the request line of this request.

Returns
  • the request line.

public URI getURI ()

Returns the URI this request uses, such as http://example.org/path/to/file.

public boolean isAborted ()

Tests if the request execution has been aborted.

Returns
  • true if the request execution has been aborted, false otherwise.

public void setConnectionRequest (ClientConnectionRequest connRequest)

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.

Throws
IOException

public void setReleaseTrigger (ConnectionReleaseTrigger releaseTrigger)

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.

Throws
IOException

public void setURI (URI uri)