接口的使用
org.springframework.web.reactive.function.client.ExchangeFilterFunction
使用ExchangeFilterFunction的程序包 程序包 说明 org.springframework.test.web.reactive.server Support for testing Spring WebFlux server endpoints viaWebTestClient
.org.springframework.web.reactive.function.client Provides a reactiveWebClient
that builds on top of theorg.springframework.http.client.reactive
reactive HTTP adapter layer.org.springframework.test.web.reactive.server中ExchangeFilterFunction的使用
参数类型为ExchangeFilterFunction的org.springframework.test.web.reactive.server中的方法 修饰符和类型 方法 说明 WebTestClient.Builder
WebTestClient.Builder. filter(ExchangeFilterFunction filter)
Add the given filter to the filter chain.类型变量类型为ExchangeFilterFunction的org.springframework.test.web.reactive.server中的方法参数 修饰符和类型 方法 说明 WebTestClient.Builder
WebTestClient.Builder. filters(Consumer<List<ExchangeFilterFunction>> filtersConsumer)
Manipulate the filters with the given consumer.org.springframework.web.reactive.function.client中ExchangeFilterFunction的使用
返回ExchangeFilterFunction的org.springframework.web.reactive.function.client中的方法 修饰符和类型 方法 说明 default ExchangeFilterFunction
ExchangeFilterFunction. andThen(ExchangeFilterFunction afterFilter)
Return a composed filter function that first applies this filter, and then applies the given"after"
filter.static ExchangeFilterFunction
ExchangeFilterFunctions. basicAuthentication()
已过时。as of Spring 5.1 in favor of usingHttpHeaders.setBasicAuth(String, String)
while building the request.static ExchangeFilterFunction
ExchangeFilterFunctions. basicAuthentication(String username, String password)
Return a filter that applies HTTP Basic Authentication to the request headers viaHttpHeaders.setBasicAuth(String)
andHttpHeaders.encodeBasicAuth(String, String, Charset)
.static ExchangeFilterFunction
ExchangeFilterFunctions. limitResponseSize(long maxByteCount)
Consume up to the specified number of bytes from the response body and cancel if any more data arrives.static ExchangeFilterFunction
ExchangeFilterFunction. ofRequestProcessor(Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
Adapt the given request processor function to a filter function that only operates on theClientRequest
.static ExchangeFilterFunction
ExchangeFilterFunction. ofResponseProcessor(Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
Adapt the given response processor function to a filter function that only operates on theClientResponse
.static ExchangeFilterFunction
ExchangeFilterFunctions. statusError(Predicate<HttpStatus> statusPredicate, Function<ClientResponse,? extends Throwable> exceptionFunction)
Return a filter that generates an error signal when the givenHttpStatus
predicate matches.参数类型为ExchangeFilterFunction的org.springframework.web.reactive.function.client中的方法 修饰符和类型 方法 说明 default ExchangeFilterFunction
ExchangeFilterFunction. andThen(ExchangeFilterFunction afterFilter)
Return a composed filter function that first applies this filter, and then applies the given"after"
filter.default ExchangeFunction
ExchangeFunction. filter(ExchangeFilterFunction filter)
Filters this exchange function with the givenExchangeFilterFunction
, resulting in a filteredExchangeFunction
.WebClient.Builder
WebClient.Builder. filter(ExchangeFilterFunction filter)
Add the given filter to the end of the filter chain.类型变量类型为ExchangeFilterFunction的org.springframework.web.reactive.function.client中的方法参数 修饰符和类型 方法 说明 WebClient.Builder
WebClient.Builder. filters(Consumer<List<ExchangeFilterFunction>> filtersConsumer)
Manipulate the filters with the given consumer.