Package com.castlabs.android.network

# Interface RequestModifier

public interface RequestModifier
Implementation of this interface can intercept `Request`s and modify them before the request is sent. This can be used for instance to implement CDN switching and change the request URI, or to add query, or header parameters.

Note that header parameters are exposed and can be changed directly on the request object. Query parameters need to be added to the `Uri` instance directly.

Since:
  4.1.2

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Request`
  `onRequest(Request request)`
  Called with the current request object.

- ## Method Details

  - ### onRequest

    @NonNull Request onRequest(@NonNull Request request) throws IOException
    Called with the current request object. Note: Do not return null here. If no modification should be applied, return the received request
    Parameters:
      `request` - The request object
    Returns:
      The potentially modified request instance. Do not return null here
    Throws:
      `IOException`