Package com.google.genai.gaos.utils
Interface Hook.BeforeRequest
- All Known Implementing Classes:
Hook.IdempotencyHook,Hooks
- Enclosing class:
- Hook
public static interface Hook.BeforeRequest
Specifies how a request is transformed before sending.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Hook.BeforeRequestThe default action is to return the request untouched. -
Method Summary
Modifier and TypeMethodDescriptionbeforeRequest(Hook.BeforeRequestContext context, HttpRequest request) Transforms the givenHttpRequestbefore sending.
-
Field Details
-
DEFAULT
The default action is to return the request untouched.
-
-
Method Details
-
beforeRequest
Transforms the givenHttpRequestbefore sending.Note that
HttpRequestis immutable. To modify the request useHttpRequest.toBuilder()which copies the request into a builder.- Parameters:
context- context for the hook callrequest- request to be transformed- Returns:
- transformed request
- Throws:
Exception- on error
-