Class HttpRequestValues.Builder
java.lang.Object
org.springframework.web.service.invoker.HttpRequestValues.Builder
- All Implemented Interfaces:
- HttpRequestValues.Metadata
- Direct Known Subclasses:
- ReactiveHttpRequestValues.Builder
- Enclosing class:
- HttpRequestValues
Builder for 
HttpRequestValues.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddAttribute(String name, Object value) Configure an attribute to associate with the request.Add the given cookie name and values.Add the given header name and values.addRequestParameter(String name, String... values) Add the given request parameter name and values.addRequestPart(String name, Object part) Add a part for a multipart request.build()Build theHttpRequestValuesinstance.protected Objectprotected HttpRequestValuescreateRequestValues(HttpMethod httpMethod, URI uri, UriBuilderFactory uriBuilderFactory, String uriTemplate, Map<String, String> uriVars, HttpHeaders headers, MultiValueMap<String, String> cookies, Map<String, Object> attributes, Object bodyValue) CreateHttpRequestValuesfrom values passed to theHttpRequestValues.Builder.Return the acceptable media types, if set already.Return the content type, if set already.Return the HTTP method, if known.Return the URI template, if set already.protected booleanhasBody()protected booleanhasParts()Set the media types for the requestAcceptheader.voidsetBodyValue(Object bodyValue) Set the request body as an Object to be serialized.setContentType(MediaType contentType) Set the media type for the requestContent-Typeheader.setHttpMethod(HttpMethod httpMethod) Set the HTTP method for the request.Set the URL to use.setUriBuilderFactory(UriBuilderFactory uriBuilderFactory) Set theUriBuilderFactorythat will be used to expand thegetUriTemplate().setUriTemplate(String uriTemplate) Set the request URL as a String template.setUriVariable(String name, String value) Add a URI variable name-value pair.
- 
Constructor Details- 
Builderpublic Builder()
 
- 
- 
Method Details- 
setHttpMethodSet the HTTP method for the request.
- 
setUriSet the URL to use. When set, this overrides the URI template from theHttpExchangeannotation.
- 
setUriBuilderFactorypublic HttpRequestValues.Builder setUriBuilderFactory(@Nullable UriBuilderFactory uriBuilderFactory) Set theUriBuilderFactorythat will be used to expand thegetUriTemplate().- Since:
- 6.1
 
- 
setUriTemplateSet the request URL as a String template.
- 
setUriVariableAdd a URI variable name-value pair.
- 
setAcceptSet the media types for the requestAcceptheader.
- 
setContentTypeSet the media type for the requestContent-Typeheader.
- 
addHeaderAdd the given header name and values.
- 
addCookieAdd the given cookie name and values.
- 
addRequestParameterAdd the given request parameter name and values.When "content-type"is set to"application/x-www-form-urlencoded", request parameters are encoded in the request body. Otherwise, they are added as URL query parameters.
- 
addRequestPartAdd a part for a multipart request. The part may be:- String -- form field
- Resource-- file part
- Object -- content to be encoded (for example, to JSON)
- HttpEntity-- part content and headers although generally it's easier to add headers through the returned builder
 
- 
addAttributeConfigure an attribute to associate with the request.- Parameters:
- name- the attribute name
- value- the attribute value
 
- 
setBodyValueSet the request body as an Object to be serialized.
- 
getHttpMethodDescription copied from interface:HttpRequestValues.MetadataReturn the HTTP method, if known.- Specified by:
- getHttpMethodin interface- HttpRequestValues.Metadata
 
- 
getUriTemplateDescription copied from interface:HttpRequestValues.MetadataReturn the URI template, if set already.- Specified by:
- getUriTemplatein interface- HttpRequestValues.Metadata
 
- 
getContentTypeDescription copied from interface:HttpRequestValues.MetadataReturn the content type, if set already.- Specified by:
- getContentTypein interface- HttpRequestValues.Metadata
 
- 
getAcceptMediaTypesDescription copied from interface:HttpRequestValues.MetadataReturn the acceptable media types, if set already.- Specified by:
- getAcceptMediaTypesin interface- HttpRequestValues.Metadata
 
- 
buildBuild theHttpRequestValuesinstance.
- 
hasPartsprotected boolean hasParts()
- 
hasBodyprotected boolean hasBody()
- 
buildMultipartBody
- 
createRequestValuesprotected HttpRequestValues createRequestValues(@Nullable HttpMethod httpMethod, @Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate, Map<String, String> uriVars, HttpHeaders headers, MultiValueMap<String, String> cookies, Map<String, Object> attributes, @Nullable Object bodyValue) CreateHttpRequestValuesfrom values passed to theHttpRequestValues.Builder.- Since:
- 6.1
 
 
-