public static interface ClientResponse.Builder
Modifier and Type | Method and Description |
---|---|
ClientResponse.Builder |
body(reactor.core.publisher.Flux<DataBuffer> body)
Set the body of the response.
|
ClientResponse.Builder |
body(String body)
Set the body of the response to the UTF-8 encoded bytes of the given string.
|
ClientResponse |
build()
Build the response.
|
ClientResponse.Builder |
cookie(String name,
String... values)
Add a cookie with the given name and value(s).
|
ClientResponse.Builder |
cookies(Consumer<MultiValueMap<String,ResponseCookie>> cookiesConsumer)
Manipulate this response's cookies with the given consumer.
|
ClientResponse.Builder |
header(String headerName,
String... headerValues)
Add the given header value(s) under the given name.
|
ClientResponse.Builder |
headers(Consumer<HttpHeaders> headersConsumer)
Manipulate this response's headers with the given consumer.
|
ClientResponse.Builder |
rawStatusCode(int statusCode)
Set the raw status code of the response.
|
ClientResponse.Builder |
statusCode(HttpStatus statusCode)
Set the status code of the response.
|
ClientResponse.Builder statusCode(HttpStatus statusCode)
statusCode
- the new status codeClientResponse.Builder rawStatusCode(int statusCode)
statusCode
- the new status codeClientResponse.Builder header(String headerName, String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
ClientResponse.Builder headers(Consumer<HttpHeaders> headersConsumer)
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 HttpHeaders
methods.
headersConsumer
- a function that consumes the HttpHeaders
ClientResponse.Builder cookie(String name, String... values)
name
- the cookie namevalues
- the cookie value(s)ClientResponse.Builder cookies(Consumer<MultiValueMap<String,ResponseCookie>> cookiesConsumer)
The map provided to the consumer is "live", so that the consumer can be used to
overwrite existing cookie values,
remove values, or use any of the other
MultiValueMap
methods.
cookiesConsumer
- a function that consumes the cookies mapClientResponse.Builder body(reactor.core.publisher.Flux<DataBuffer> body)
Calling this methods will release the existing body of the builder.
body
- the new bodyClientResponse.Builder body(String body)
Calling this methods will release the existing body of the builder.
body
- the new bodyClientResponse build()