类 ExchangeFilterFunctions
java.lang.Object
cn.taketoday.web.reactive.function.client.ExchangeFilterFunctions
Static factory methods providing access to built-in implementations of
ExchangeFilterFunction for basic authentication, error handling, etc.- 从以下版本开始:
- 4.0
- 作者:
- Rob Winch, Arjen Poutsma, Sam Brannen, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明static final recordStores username and password for HTTP basic authentication. -
字段概要
字段修饰符和类型字段说明private static final StringName of the request attribute withExchangeFilterFunctions.CredentialsforbasicAuthentication(). -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static ExchangeFilterFunctionVariant ofbasicAuthentication(String, String)that looks up theCredentialsin arequest attribute.static ExchangeFilterFunctionbasicAuthentication(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 ExchangeFilterFunctionlimitResponseSize(long maxByteCount) Consume up to the specified number of bytes from the response body and cancel if any more data arrives.static ExchangeFilterFunctionstatusError(Predicate<HttpStatusCode> statusPredicate, Function<ClientResponse, ? extends Throwable> exceptionFunction) Return a filter that generates an error signal when the givenHttpStatuspredicate matches.
-
字段详细资料
-
BASIC_AUTHENTICATION_CREDENTIALS_ATTRIBUTE
Name of the request attribute withExchangeFilterFunctions.CredentialsforbasicAuthentication().
-
-
构造器详细资料
-
ExchangeFilterFunctions
public ExchangeFilterFunctions()
-
-
方法详细资料
-
limitResponseSize
Consume up to the specified number of bytes from the response body and cancel if any more data arrives.Internally delegates to
DataBufferUtils.takeUntilByteCount(org.reactivestreams.Publisher<T>, long).- 参数:
maxByteCount- the limit as number of bytes- 返回:
- the filter to limit the response size with
-
statusError
public static ExchangeFilterFunction statusError(Predicate<HttpStatusCode> statusPredicate, Function<ClientResponse, ? extends Throwable> exceptionFunction) Return a filter that generates an error signal when the givenHttpStatuspredicate matches.- 参数:
statusPredicate- the predicate to check the HTTP status withexceptionFunction- the function that to create the exception- 返回:
- the filter to generate an error signal
-
basicAuthentication
Return a filter that applies HTTP Basic Authentication to the request headers viaHttpHeaders.setBasicAuth(String)andHttpHeaders.encodeBasicAuth(String, String, Charset).- 参数:
username- the usernamepassword- the password- 返回:
- the filter to add authentication headers with
- 另请参阅:
-
basicAuthentication
Variant ofbasicAuthentication(String, String)that looks up theCredentialsin arequest attribute.- 返回:
- the filter to use
- 另请参阅:
-