Package org.springframework.web.service.invoker

# Class HttpRequestValues

java.lang.Object
org.springframework.web.service.invoker.HttpRequestValues

Direct Known Subclasses:
  `ReactiveHttpRequestValues`

public class HttpRequestValues extends Object
Container for HTTP request values extracted from an `@HttpExchange`-annotated method and argument values passed to it. This is then given to `HttpExchangeAdapter` to adapt to the underlying HTTP client.

Since:
  6.0
Author:
  Rossen Stoyanchev, Olga Maciaszek-Sharma

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`HttpRequestValues.Builder`
Builder for `HttpRequestValues`.
`static interface`
`HttpRequestValues.Metadata`
Expose static metadata from `@HttpExchange` annotation attributes.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`HttpRequestValues(HttpMethod httpMethod, URI uri, UriBuilderFactory uriBuilderFactory, String uriTemplate, Map<String,String> uriVariables, HttpHeaders headers, org.springframework.util.MultiValueMap<String,String> cookies, Map<String,Object> attributes, Object bodyValue)`
Construct `HttpRequestValues`.

## Method Summary

Modifier and Type
Method
Description
`static HttpRequestValues.Builder`
`builder()`
`Map<String,Object>`
`getAttributes()`
Return the attributes associated with the request, or an empty map.
`Object`
`getBodyValue()`
Return the request body as a value to be serialized, if set.
`org.springframework.core.ParameterizedTypeReference<?>`
`getBodyValueType()`
Return the type for the body value.
`org.springframework.util.MultiValueMap<String,String>`
`getCookies()`
Return the cookies for the request, or an empty map.
`HttpHeaders`
`getHeaders()`
Return the headers for the request, if any.
`HttpMethod`
`getHttpMethod()`
Return the HTTP method to use for the request.
`URI`
`getUri()`
Return the URL to use.
`UriBuilderFactory`
`getUriBuilderFactory()`
Return the `UriBuilderFactory` to expand the `uriTemplate` and `getUriVariables()` with.
`String`
`getUriTemplate()`
Return the URL template for the request.
`Map<String,String>`
`getUriVariables()`
Return the URL template variables, or an empty map.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HttpRequestValues

protected HttpRequestValues(@Nullable HttpMethod httpMethod, @Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate, Map<String,String> uriVariables, HttpHeaders headers, org.springframework.util.MultiValueMap<String,String> cookies, Map<String,Object> attributes, @Nullable Object bodyValue)
Construct `HttpRequestValues`.

Since:
  6.1

## Method Details

### getHttpMethod

@Nullable public HttpMethod getHttpMethod()
Return the HTTP method to use for the request.

### getUri

@Nullable public URI getUri()
Return the URL to use.

Typically, this comes from a `URI` method argument, which provides the caller with the option to override the `uriTemplate` from class and method `HttpExchange` annotations.

### getUriBuilderFactory

@Nullable public UriBuilderFactory getUriBuilderFactory()
Return the `UriBuilderFactory` to expand the `uriTemplate` and `getUriVariables()` with.

The `UriBuilderFactory` is passed into the HTTP interface method in order to override the UriBuilderFactory (and its baseUrl) used by the underlying client.

Since:
  6.1

### getUriTemplate

@Nullable public String getUriTemplate()
Return the URL template for the request. This comes from the values in class and method `HttpExchange` annotations.

### getUriVariables

public Map<String,String> getUriVariables()
Return the URL template variables, or an empty map.

### getHeaders

public HttpHeaders getHeaders()
Return the headers for the request, if any.

### getCookies

public org.springframework.util.MultiValueMap<String,String> getCookies()
Return the cookies for the request, or an empty map.

### getAttributes

public Map<String,Object> getAttributes()
Return the attributes associated with the request, or an empty map.

### getBodyValue

@Nullable public Object getBodyValue()
Return the request body as a value to be serialized, if set.

### getBodyValueType

@Nullable public org.springframework.core.ParameterizedTypeReference<?> getBodyValueType()
Return the type for the body value.

Since:
  6.2.7

### builder

public static HttpRequestValues.Builder builder()