Package org.springframework.web.server

# Interface ServerWebExchange.Builder

Enclosing interface:
  ServerWebExchange

public static interface ServerWebExchange.Builder
Builder for mutating an existing `ServerWebExchange`. Removes the need

## Method Summary

Modifier and Type
Method
Description
`ServerWebExchange`
`build()`
Build a `ServerWebExchange` decorator with the mutated properties.
`ServerWebExchange.Builder`
`principal(reactor.core.publisher.Mono<Principal> principalMono)`
Set the `Mono<Principal>` to return for this exchange.
`ServerWebExchange.Builder`
`request(Consumer<ServerHttpRequest.Builder> requestBuilderConsumer)`
Configure a consumer to modify the current request using a builder.
`ServerWebExchange.Builder`
`request(ServerHttpRequest request)`
Set the request to use especially when there is a need to override `ServerHttpRequest` methods.
`ServerWebExchange.Builder`
`response(ServerHttpResponse response)`
Set the response to use.

## Method Details

### request

ServerWebExchange.Builder request(Consumer<ServerHttpRequest.Builder> requestBuilderConsumer)
Configure a consumer to modify the current request using a builder.

Effectively this:

     exchange.mutate().request(builder -> builder.method(HttpMethod.PUT));

     // vs...

     ServerHttpRequest request = exchange.getRequest().mutate()
         .method(HttpMethod.PUT)
         .build();

     exchange.mutate().request(request);

See Also:
  - `ServerHttpRequest.mutate()`

### request

ServerWebExchange.Builder request(ServerHttpRequest request)
Set the request to use especially when there is a need to override `ServerHttpRequest` methods. To simply mutate request properties see `request(Consumer)` instead.

See Also:
  - `ServerHttpRequestDecorator`

### response

ServerWebExchange.Builder response(ServerHttpResponse response)
Set the response to use.

See Also:
  - `ServerHttpResponseDecorator`

### principal

ServerWebExchange.Builder principal(reactor.core.publisher.Mono<Principal> principalMono)
Set the `Mono<Principal>` to return for this exchange.

### build

ServerWebExchange build()
Build a `ServerWebExchange` decorator with the mutated properties.