Class HttpRequestWrapper
java.lang.Object
org.springframework.http.client.support.HttpRequestWrapper
- All Implemented Interfaces:
HttpMessage
,HttpRequest
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.
- Since:
- 3.1
- Author:
- Arjen Poutsma
-
Constructor Summary
ConstructorDescriptionHttpRequestWrapper
(HttpRequest request) Create a newHttpRequest
wrapping the given request object. -
Method Summary
Modifier and TypeMethodDescriptionReturn the headers of the wrapped request.Return the method of the wrapped request.Return the wrapped request.getURI()
Return the URI of the wrapped request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.HttpRequest
getMethodValue
-
Constructor Details
-
HttpRequestWrapper
Create a newHttpRequest
wrapping the given request object.- Parameters:
request
- the request object to be wrapped
-
-
Method Details
-
getRequest
Return the wrapped request. -
getMethod
Return the method of the wrapped request.- Specified by:
getMethod
in interfaceHttpRequest
- Returns:
- the HTTP method as an HttpMethod value
- See Also:
-
getURI
Return the URI of the wrapped request.- Specified by:
getURI
in interfaceHttpRequest
- Returns:
- the URI of the request (never
null
)
-
getHeaders
Return the headers of the wrapped request.- Specified by:
getHeaders
in interfaceHttpMessage
- Returns:
- a corresponding HttpHeaders object (never
null
)
-