public static interface ServerRequest.Builder
Modifier and Type | Method and Description |
---|---|
ServerRequest.Builder |
attribute(java.lang.String name,
java.lang.Object value)
Adds an attribute with the given name and value.
|
ServerRequest.Builder |
attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Manipulate this request's attributes with the given consumer.
|
ServerRequest.Builder |
body(reactor.core.publisher.Flux<DataBuffer> body)
Sets the body of the request.
|
ServerRequest.Builder |
body(java.lang.String body)
Sets the body of the request to the UTF-8 encoded bytes of the given string.
|
ServerRequest |
build()
Builds the request.
|
ServerRequest.Builder |
cookie(java.lang.String name,
java.lang.String... values)
Add a cookie with the given name and value(s).
|
ServerRequest.Builder |
cookies(java.util.function.Consumer<MultiValueMap<java.lang.String,HttpCookie>> cookiesConsumer)
Manipulate this request's cookies with the given consumer.
|
ServerRequest.Builder |
header(java.lang.String headerName,
java.lang.String... headerValues)
Add the given header value(s) under the given name.
|
ServerRequest.Builder |
headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
Manipulate this request's headers with the given consumer.
|
ServerRequest.Builder |
method(HttpMethod method)
Set the method of the request.
|
ServerRequest.Builder |
uri(java.net.URI uri)
Set the uri of the request.
|
ServerRequest.Builder method(HttpMethod method)
method
- the new methodServerRequest.Builder uri(java.net.URI uri)
uri
- the new uriServerRequest.Builder header(java.lang.String headerName, java.lang.String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
ServerRequest.Builder headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
HttpHeaders
methods.headersConsumer
- a function that consumes the HttpHeaders
ServerRequest.Builder cookie(java.lang.String name, java.lang.String... values)
name
- the cookie namevalues
- the cookie value(s)ServerRequest.Builder cookies(java.util.function.Consumer<MultiValueMap<java.lang.String,HttpCookie>> cookiesConsumer)
MultiValueMap
methods.cookiesConsumer
- a function that consumes the cookies mapServerRequest.Builder body(reactor.core.publisher.Flux<DataBuffer> body)
body
- the new body.ServerRequest.Builder body(java.lang.String body)
body
- the new body.ServerRequest.Builder attribute(java.lang.String name, java.lang.Object value)
name
- the attribute namevalue
- the attribute valueServerRequest.Builder attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Map
methods.attributesConsumer
- a function that consumes the attributes mapServerRequest build()