OptionalafterCalled after every response (including 4xx/5xx). Fires before error handling. The response passed to this hook is a clone — reading its body will not affect the caller. However, avoid heavy body reads in hot paths.
Note: For SSE (text/event-stream) responses this hook is intentionally
skipped because response.clone() tees the underlying ReadableStream and,
if the cloned branch is not fully consumed, buffers indefinitely for
long-lived streams.
OptionalbeforeCalled before every request. Can inspect the URL and mutate init (e.g. headers).
OptionalonCalled on request failure (after retries exhausted).
Lifecycle hooks for request/response interception.