Package dev.dosya.sdk
Interface DosyaInterceptor
public interface DosyaInterceptor
Interceptor for observing HTTP requests and responses made by the SDK.
Implement this interface to add custom telemetry, logging, or metrics collection.
Register it via DosyaClientOptions.interceptor(DosyaInterceptor).
Implementations must be thread-safe. Methods are called from the thread performing the HTTP request, which may be a thread-pool thread during multipart uploads.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterResponse(String method, String url, int statusCode, String requestId, long durationMs) Called after each HTTP response is received.voidbeforeRequest(String method, String url) Called before each HTTP request is sent.
-
Method Details
-
beforeRequest
Called before each HTTP request is sent.- Parameters:
method- the HTTP method (GET, POST, PUT, DELETE)url- the full request URL including query parameters
-
afterResponse
Called after each HTTP response is received.- Parameters:
method- the HTTP method (GET, POST, PUT, DELETE)url- the full request URL including query parametersstatusCode- the HTTP response status coderequestId- the server-returned request ID from theX-Request-Idheader, or nulldurationMs- the request duration in milliseconds
-