public abstract class ExchangeFilterFunctions extends Object
ExchangeFilterFunction for basic authentication, error handling, etc.| Modifier and Type | Class and Description |
|---|---|
static class |
ExchangeFilterFunctions.Credentials
Deprecated.
as of Spring 5.1 in favor of using
HttpHeaders.setBasicAuth(String, String) while building the request. |
| Modifier and Type | Field and Description |
|---|---|
static String |
BASIC_AUTHENTICATION_CREDENTIALS_ATTRIBUTE
Deprecated.
as of Spring 5.1 in favor of using
HttpHeaders.setBasicAuth(String, String) while building the request. |
| Constructor and Description |
|---|
ExchangeFilterFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static ExchangeFilterFunction |
basicAuthentication()
Deprecated.
as of Spring 5.1 in favor of using
HttpHeaders.setBasicAuth(String, String) while building the request. |
static ExchangeFilterFunction |
basicAuthentication(String username,
String password)
Return a filter that applies HTTP Basic Authentication to the request
headers via
HttpHeaders.setBasicAuth(String) and
HttpHeaders.encodeBasicAuth(String, String, Charset). |
static ExchangeFilterFunction |
limitResponseSize(long maxByteCount)
Consume up to the specified number of bytes from the response body and
cancel if any more data arrives.
|
static ExchangeFilterFunction |
statusError(Predicate<HttpStatus> statusPredicate,
Function<ClientResponse,? extends Throwable> exceptionFunction)
Return a filter that generates an error signal when the given
HttpStatus predicate matches. |
@Deprecated public static final String BASIC_AUTHENTICATION_CREDENTIALS_ATTRIBUTE
HttpHeaders.setBasicAuth(String, String) while building the request.ExchangeFilterFunctions.Credentials for basicAuthentication().public static ExchangeFilterFunction limitResponseSize(long maxByteCount)
Internally delegates to DataBufferUtils.takeUntilByteCount(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>, long).
maxByteCount - the limit as number of bytespublic static ExchangeFilterFunction statusError(Predicate<HttpStatus> statusPredicate, Function<ClientResponse,? extends Throwable> exceptionFunction)
HttpStatus predicate matches.statusPredicate - the predicate to check the HTTP status withexceptionFunction - the function that to create the exceptionpublic static ExchangeFilterFunction basicAuthentication(String username, String password)
HttpHeaders.setBasicAuth(String) and
HttpHeaders.encodeBasicAuth(String, String, Charset).username - the usernamepassword - the passwordHttpHeaders.encodeBasicAuth(String, String, Charset),
HttpHeaders.setBasicAuth(String)@Deprecated public static ExchangeFilterFunction basicAuthentication()
HttpHeaders.setBasicAuth(String, String) while building the request.basicAuthentication(String, String) that looks up
the Credentials in a
request attribute.ExchangeFilterFunctions.Credentials