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 Type
    Method
    Description
    void
    afterResponse(String method, String url, int statusCode, String requestId, long durationMs)
    Called after each HTTP response is received.
    void
    beforeRequest(String method, String url)
    Called before each HTTP request is sent.
  • Method Details

    • beforeRequest

      void beforeRequest(String method, String url)
      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

      void afterResponse(String method, String url, int statusCode, String requestId, long durationMs)
      Called after each HTTP response is received.
      Parameters:
      method - the HTTP method (GET, POST, PUT, DELETE)
      url - the full request URL including query parameters
      statusCode - the HTTP response status code
      requestId - the server-returned request ID from the X-Request-Id header, or null
      durationMs - the request duration in milliseconds