public class

RequestWrapper

extends AbstractHttpMessage
implements HttpUriRequest
java.lang.Object
   ↳ org.apache.http.message.AbstractHttpMessage
     ↳ org.apache.http.impl.client.RequestWrapper
Known Direct Subclasses

Class Overview

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.

Summary

[Expand]
Inherited Fields
From class org.apache.http.message.AbstractHttpMessage
Public Constructors
RequestWrapper(HttpRequest request)
Public Methods
void abort()
Aborts execution of the request.
int getExecCount()
String getMethod()
Returns the HTTP method this request uses, such as GET, PUT, POST, or other.
HttpRequest getOriginal()
ProtocolVersion getProtocolVersion()
RequestLine getRequestLine()
URI getURI()
Returns the URI this request uses, such as http://example.org/path/to/file.
void incrementExecCount()
boolean isAborted()
Tests if the request execution has been aborted.
boolean isRepeatable()
void resetHeaders()
void setMethod(String method)
void setProtocolVersion(ProtocolVersion version)
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.HttpUriRequest

Public Constructors

public RequestWrapper (HttpRequest request)

Also: HttpClient

Public Methods

public void abort ()

Also: HttpClient

Aborts execution of the request.

public int getExecCount ()

Also: HttpClient

public String getMethod ()

Also: HttpClient

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

public HttpRequest getOriginal ()

Also: HttpClient

public ProtocolVersion getProtocolVersion ()

Also: HttpClient

public RequestLine getRequestLine ()

Also: HttpClient

public URI getURI ()

Also: HttpClient

Returns the URI this request uses, such as http://example.org/path/to/file.
Note that the URI may be absolute URI (as above) or may be a relative URI.

Implementations are encouraged to return the URI that was initially requested.

To find the final URI after any redirects have been processed, please see the section entitled HTTP execution context in the HttpClient Tutorial

public void incrementExecCount ()

Also: HttpClient

public boolean isAborted ()

Also: HttpClient

Tests if the request execution has been aborted.

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

public boolean isRepeatable ()

Also: HttpClient

public void resetHeaders ()

Also: HttpClient

public void setMethod (String method)

Also: HttpClient

public void setProtocolVersion (ProtocolVersion version)

Also: HttpClient

public void setURI (URI uri)

Also: HttpClient