Top Description Fields Constructors Methods
org.springframework.http.client.support

public Class HttpRequestWrapper

extends Object
implements HttpRequest
Class Inheritance
All Implemented Interfaces
org.springframework.http.HttpRequest, org.springframework.http.HttpMessage
Imports
java.net.URI, org.springframework.http.HttpHeaders, .HttpMethod, .HttpRequest, org.springframework.util.Assert

Provides a convenient implementation of the HttpRequest interface that can be overridden to adapt the request.

These methods default to calling through to the wrapped request object.

Author
Arjen Poutsma
Since
3.1

Field Summary

Modifier and TypeField and Description
private final HttpRequest

Constructor Summary

AccessConstructor and Description
public
HttpRequestWrapper(HttpRequest
the request object to be wrapped
request
)

Create a new HttpRequest wrapping the given request object.

Method Summary

Modifier and TypeMethod and Description
public HttpHeaders
getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Return the headers of the wrapped request.
public HttpMethod
getMethod()

Implements org.springframework.http.HttpRequest.getMethod.

Return the method of the wrapped request.
public HttpRequest
getRequest()

Return the wrapped request.

public URI
getURI()

Implements org.springframework.http.HttpRequest.getURI.

Return the URI of the wrapped request.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

requestback to summary
private final HttpRequest request

Constructor Detail

HttpRequestWrapperback to summary
public HttpRequestWrapper(HttpRequest request)

Create a new HttpRequest wrapping the given request object.

Parameters
request:HttpRequest

the request object to be wrapped

Method Detail

getHeadersback to summary
public HttpHeaders getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Return the headers of the wrapped request.

Returns:HttpHeaders

Doc from org.springframework.http.HttpMessage.getHeaders.

a corresponding HttpHeaders object (never null)

Annotations
@Override
getMethodback to summary
public HttpMethod getMethod()

Implements org.springframework.http.HttpRequest.getMethod.

Return the method of the wrapped request.

Returns:HttpMethod

Doc from org.springframework.http.HttpRequest.getMethod.

the HTTP method as an HttpMethod value

Annotations
@Override
getRequestback to summary
public HttpRequest getRequest()

Return the wrapped request.

getURIback to summary
public URI getURI()

Implements org.springframework.http.HttpRequest.getURI.

Return the URI of the wrapped request.

Returns:URI

Doc from org.springframework.http.HttpRequest.getURI.

the URI of the request (never null)

Annotations
@Override