Package pl.gsmservice.gateway.utils
Interface AsyncHook.BeforeRequest
-
- All Known Implementing Classes:
AsyncHook.IdempotencyHook,AsyncHooks
- Enclosing class:
- AsyncHook
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface AsyncHook.BeforeRequestSpecifies how a request is transformed before sending.
-
-
Field Summary
Fields Modifier and Type Field Description static AsyncHook.BeforeRequestDEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.net.http.HttpRequest>beforeRequest(Hook.BeforeRequestContext context, java.net.http.HttpRequest request)Transforms the givenHttpRequestbefore sending.
-
-
-
Field Detail
-
DEFAULT
static final AsyncHook.BeforeRequest DEFAULT
-
-
Method Detail
-
beforeRequest
java.util.concurrent.CompletableFuture<java.net.http.HttpRequest> beforeRequest(Hook.BeforeRequestContext context, java.net.http.HttpRequest request)
Transforms the givenHttpRequestbefore sending.Note that
HttpRequestis immutable. To modify the request you can useHttpRequest#newBuilder(HttpRequest, BiPredicate<String, String>)with JDK 16 and later (which will copy the request for modification in a builder). If that method is not available then useHelpers.copy(java.net.http.HttpRequest)(which also returns a builder).- Parameters:
context- context for the hook callrequest- request to be transformed- Returns:
- transformed request
-
-