Interface ServerRequest.Builder
- Enclosing interface:
- ServerRequest
public static interface ServerRequest.Builder
Defines a builder for a request.
- Since:
- 5.1
- 
Method SummaryModifier and TypeMethodDescriptionAdd an attribute with the given name and value.attributes(Consumer<Map<String, Object>> attributesConsumer) Manipulate this request's attributes with the given consumer.Set the body of the request to the UTF-8 encoded bytes of the given string.body(reactor.core.publisher.Flux<DataBuffer> body) Set the body of the request.build()Build the request.contextPath(String contextPath) Set the context path of the request.Add a cookie with the given name and value(s).cookies(Consumer<MultiValueMap<String, HttpCookie>> cookiesConsumer) Manipulate this request's cookies with the given consumer.Add the given header value(s) under the given name.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this request's headers with the given consumer.method(HttpMethod method) Set the method of the request.Set the URI of the request.
- 
Method Details- 
methodSet the method of the request.- Parameters:
- method- the new method
- Returns:
- this builder
 
- 
uriSet the URI of the request.- Parameters:
- uri- the new URI
- Returns:
- this builder
 
- 
contextPathSet the context path of the request.- Parameters:
- contextPath- the new context path
- Returns:
- this builder
- Since:
- 5.3.23
 
- 
headerAdd the given header value(s) under the given name.- Parameters:
- headerName- the header name
- headerValues- the header value(s)
- Returns:
- this builder
- See Also:
 
- 
headersManipulate this request's headers with the given consumer.The headers provided to the consumer are "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the other HttpHeadersmethods.- Parameters:
- headersConsumer- a function that consumes the- HttpHeaders
- Returns:
- this builder
 
- 
cookieAdd a cookie with the given name and value(s).- Parameters:
- name- the cookie name
- values- the cookie value(s)
- Returns:
- this builder
 
- 
cookiesManipulate this request's cookies with the given consumer.The map provided to the consumer is "live", so that the consumer can be used to overwrite existing cookies, remove cookies, or use any of the other MultiValueMapmethods.- Parameters:
- cookiesConsumer- a function that consumes the cookies map
- Returns:
- this builder
 
- 
bodySet the body of the request.Calling this methods will release the existing body of the builder. - Parameters:
- body- the new body
- Returns:
- this builder
 
- 
bodySet the body of the request to the UTF-8 encoded bytes of the given string.Calling this methods will release the existing body of the builder. - Parameters:
- body- the new body
- Returns:
- this builder
 
- 
attributeAdd an attribute with the given name and value.- Parameters:
- name- the attribute name
- value- the attribute value
- Returns:
- this builder
 
- 
attributesManipulate this request's attributes with the given consumer.The map provided to the consumer is "live", so that the consumer can be used to overwrite existing attributes, remove attributes, or use any of the other Mapmethods.- Parameters:
- attributesConsumer- a function that consumes the attributes map
- Returns:
- this builder
 
- 
buildServerRequest build()Build the request.- Returns:
- the built request
 
 
-