Top Description Inners Fields Constructors Methods
org.apache.http.client.methods

public Class HttpRequestWrapper

extends AbstractHttpMessage
implements HttpUriRequest
Class Inheritance
All Implemented Interfaces
org.apache.http.client.methods.HttpUriRequest, org.apache.http.HttpRequest, org.apache.http.HttpMessage
Known Direct Subclasses
org.apache.http.client.methods.HttpRequestWrapper.HttpEntityEnclosingRequestWrapper
Annotations
@SuppressWarnings:deprecation
Imports
java.net.URI, org.apache.http.Header, .HttpEntity, .HttpEntityEnclosingRequest, .HttpHost, .HttpRequest, .ProtocolVersion, .RequestLine, org.apache.http.message.AbstractHttpMessage, .BasicRequestLine, org.apache.http.params.HttpParams, org.apache.http.protocol.HTTP, org.apache.http.util.Args

A wrapper class for HttpRequest that can be used to change properties of the current request without modifying the original object.
Since
4.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final String
private final HttpRequest
private RequestLine
private final HttpHost
private URI
private ProtocolVersion
Inherited from org.apache.http.message.AbstractHttpMessage:
headergroupparams

Constructor Summary

AccessConstructor and Description
private
HttpRequestWrapper(final HttpRequest request, final HttpHost target)

Method Summary

Modifier and TypeMethod and Description
public void
abort()

Implements org.apache.http.client.methods.HttpUriRequest.abort.

Aborts execution of the request.
public String
getMethod()

Implements org.apache.http.client.methods.HttpUriRequest.getMethod.

Returns the HTTP method this request uses, such as GET, PUT, POST, or other.
public HttpRequest
public HttpParams
getParams()

Overrides org.apache.http.message.AbstractHttpMessage.getParams.

Implements org.apache.http.HttpMessage.getParams.

Returns the parameters effective for this message as set by setParams(HttpParams).
public ProtocolVersion
getProtocolVersion()

Implements org.apache.http.HttpMessage.getProtocolVersion.

Returns the protocol version this message is compatible with.
public RequestLine
getRequestLine()

Implements org.apache.http.HttpRequest.getRequestLine.

Returns the request line of this request.
public HttpHost
public URI
getURI()

Implements org.apache.http.client.methods.HttpUriRequest.getURI.

Returns the URI this request uses, such as http://example.org/path/to/file.
public boolean
isAborted()

Implements org.apache.http.client.methods.HttpUriRequest.isAborted.

Tests if the request execution has been aborted.
public void
public void
setURI(final URI uri)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public static HttpRequestWrapper

Returns:

mutable request wrappering the original one
wrap
(final HttpRequest
original request
request
)

Creates a mutable wrapper of the original request.

public static HttpRequestWrapper

Returns:

mutable request wrappering the original one
wrap
(final HttpRequest
original request
request
,
final HttpHost
original target, if explicitly specified
target
)

Creates a mutable wrapper of the original request.

Inherited from org.apache.http.message.AbstractHttpMessage:
addHeaderaddHeadercontainsHeadergetAllHeadersgetFirstHeadergetHeadersgetLastHeaderheaderIteratorheaderIteratorremoveHeaderremoveHeaderssetHeadersetHeadersetHeaderssetParams

Field Detail

methodback to summary
private final String method
originalback to summary
private final HttpRequest original
requestLineback to summary
private RequestLine requestLine
targetback to summary
private final HttpHost target
uriback to summary
private URI uri
versionback to summary
private ProtocolVersion version

Constructor Detail

HttpRequestWrapperback to summary
private HttpRequestWrapper(final HttpRequest request, final HttpHost target)

Method Detail

abortback to summary
public void abort() throws UnsupportedOperationException

Implements org.apache.http.client.methods.HttpUriRequest.abort.

Doc from org.apache.http.client.methods.HttpUriRequest.abort.

Aborts execution of the request.

Annotations
@Override
Exceptions
UnsupportedOperationException:
if the abort operation is not supported / cannot be implemented.
getMethodback to summary
public String getMethod()

Implements org.apache.http.client.methods.HttpUriRequest.getMethod.

Doc from org.apache.http.client.methods.HttpUriRequest.getMethod.

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

Annotations
@Override
getOriginalback to summary
public HttpRequest getOriginal()
getParamsback to summary
public HttpParams getParams()

Overrides org.apache.http.message.AbstractHttpMessage.getParams.

Implements org.apache.http.HttpMessage.getParams.

Doc from org.apache.http.HttpMessage.getParams.

Returns the parameters effective for this message as set by setParams(HttpParams).

Annotations
@Override
@Deprecated
getProtocolVersionback to summary
public ProtocolVersion getProtocolVersion()

Implements org.apache.http.HttpMessage.getProtocolVersion.

Doc from org.apache.http.HttpMessage.getProtocolVersion.

Returns the protocol version this message is compatible with.

Annotations
@Override
getRequestLineback to summary
public RequestLine getRequestLine()

Implements org.apache.http.HttpRequest.getRequestLine.

Doc from org.apache.http.HttpRequest.getRequestLine.

Returns the request line of this request.

Returns:RequestLine

the request line.

Annotations
@Override
getTargetback to summary
public HttpHost getTarget()
Since
4.4
getURIback to summary
public URI getURI()

Implements org.apache.http.client.methods.HttpUriRequest.getURI.

Doc from org.apache.http.client.methods.HttpUriRequest.getURI.

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

Annotations
@Override
isAbortedback to summary
public boolean isAborted()

Implements org.apache.http.client.methods.HttpUriRequest.isAborted.

Doc from org.apache.http.client.methods.HttpUriRequest.isAborted.

Tests if the request execution has been aborted.

Returns:boolean

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

Annotations
@Override
setProtocolVersionback to summary
public void setProtocolVersion(final ProtocolVersion version)
setURIback to summary
public void setURI(final URI uri)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
wrapback to summary
public static HttpRequestWrapper wrap(final HttpRequest request)

Creates a mutable wrapper of the original request.

Parameters
request:HttpRequest

original request

Returns:HttpRequestWrapper

mutable request wrappering the original one

wrapback to summary
public static HttpRequestWrapper wrap(final HttpRequest request, final HttpHost target)

Creates a mutable wrapper of the original request.

Parameters
request:HttpRequest

original request

target:HttpHost

original target, if explicitly specified

Returns:HttpRequestWrapper

mutable request wrappering the original one

Since
4.4
org.apache.http.client.methods back to summary

pack-priv Class HttpRequestWrapper.HttpEntityEnclosingRequestWrapper

extends HttpRequestWrapper
implements HttpEntityEnclosingRequest
Class Inheritance
All Implemented Interfaces
org.apache.http.HttpEntityEnclosingRequest, org.apache.http.HttpRequest, org.apache.http.HttpMessage

Field Summary

Modifier and TypeField and Description
private HttpEntity

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
expectContinue()

Implements org.apache.http.HttpEntityEnclosingRequest.expectContinue.

Tells if this request should use the expect-continue handshake.
public HttpEntity
getEntity()

Implements org.apache.http.HttpEntityEnclosingRequest.getEntity.

Returns the entity associated with this request.
public void
setEntity(final HttpEntity
the entity to send.
entity
)

Implements org.apache.http.HttpEntityEnclosingRequest.setEntity.

Associates the entity with this request.
Inherited from org.apache.http.client.methods.HttpRequestWrapper:
abortgetMethodgetOriginalgetParamsgetProtocolVersiongetRequestLinegetTargetgetURIisAbortedsetProtocolVersionsetURItoStringwrapwrap

Field Detail

entityback to summary
private HttpEntity entity

Constructor Detail

HttpEntityEnclosingRequestWrapperback to summary
pack-priv HttpEntityEnclosingRequestWrapper(final HttpEntityEnclosingRequest request, final HttpHost target)

Method Detail

expectContinueback to summary
public boolean expectContinue()

Implements org.apache.http.HttpEntityEnclosingRequest.expectContinue.

Doc from org.apache.http.HttpEntityEnclosingRequest.expectContinue.

Tells if this request should use the expect-continue handshake. The expect continue handshake gives the server a chance to decide whether to accept the entity enclosing request before the possibly lengthy entity is sent across the wire.

Returns:boolean

true if the expect continue handshake should be used, false if not.

Annotations
@Override
getEntityback to summary
public HttpEntity getEntity()

Implements org.apache.http.HttpEntityEnclosingRequest.getEntity.

Doc from org.apache.http.HttpEntityEnclosingRequest.getEntity.

Returns the entity associated with this request.

Returns:HttpEntity

entity

Annotations
@Override
setEntityback to summary
public void setEntity(final HttpEntity entity)

Implements org.apache.http.HttpEntityEnclosingRequest.setEntity.

Doc from org.apache.http.HttpEntityEnclosingRequest.setEntity.

Associates the entity with this request.

Parameters
entity:HttpEntity

the entity to send.

Annotations
@Override