Spring Framework

org.springframework.http.client.support
Class HttpRequestWrapper

java.lang.Object
  extended by org.springframework.http.client.support.HttpRequestWrapper
All Implemented Interfaces:
HttpMessage, HttpRequest

public class HttpRequestWrapper
extends java.lang.Object
implements HttpRequest

Provides a convenient implementation of the HttpRequest interface that can be overridden to adapt the request. Methods default to calling through to the wrapped request object.

Since:
3.1
Author:
Arjen Poutsma

Constructor Summary
HttpRequestWrapper(HttpRequest request)
          Creates a new HttpRequest wrapping the given request object.
 
Method Summary
 HttpHeaders getHeaders()
          Returns the headers of the wrapped request.
 HttpMethod getMethod()
          Returns the method of the wrapped request.
 HttpRequest getRequest()
          Returns the wrapped request.
 java.net.URI getURI()
          Returns the URI of the wrapped request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequestWrapper

public HttpRequestWrapper(HttpRequest request)
Creates a new HttpRequest wrapping the given request object.

Parameters:
request - the request object to be wrapped
Method Detail

getRequest

public HttpRequest getRequest()
Returns the wrapped request.


getMethod

public HttpMethod getMethod()
Returns the method of the wrapped request.

Specified by:
getMethod in interface HttpRequest
Returns:
the HTTP method as an HttpMethod enum value

getURI

public java.net.URI getURI()
Returns the URI of the wrapped request.

Specified by:
getURI in interface HttpRequest
Returns:
the URI of the request

getHeaders

public HttpHeaders getHeaders()
Returns the headers of the wrapped request.

Specified by:
getHeaders in interface HttpMessage
Returns:
a corresponding HttpHeaders object

Spring Framework