接口 ServerWebExchange.Builder
- 封闭接口:
- ServerWebExchange
public static interface ServerWebExchange.Builder
Builder for mutating an existingServerWebExchange. Removes the need
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 ServerWebExchangebuild()Build aServerWebExchangedecorator with the mutated properties.ServerWebExchange.Builderprincipal(reactor.core.publisher.Mono<Principal> principalMono)Set theMono<Principal>to return for this exchange.ServerWebExchange.Builderrequest(Consumer<ServerHttpRequest.Builder> requestBuilderConsumer)Configure a consumer to modify the current request using a builder.ServerWebExchange.Builderrequest(ServerHttpRequest request)Set the request to use especially when there is a need to overrideServerHttpRequestmethods.ServerWebExchange.Builderresponse(ServerHttpResponse response)Set the response to use.
方法详细资料
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);
request
ServerWebExchange.Builder request(ServerHttpRequest request)
Set the request to use especially when there is a need to overrideServerHttpRequestmethods. To simply mutate request properties seerequest(Consumer)instead.
response
ServerWebExchange.Builder response(ServerHttpResponse response)
Set the response to use.
principal
ServerWebExchange.Builder principal(reactor.core.publisher.Mono<Principal> principalMono)
Set theMono<Principal>to return for this exchange.
build
ServerWebExchange build()
Build aServerWebExchangedecorator with the mutated properties.