Package com.castlabs.android.network

# Interface RequestModifier

All Known Implementing Classes:
  `BaseRequestModifier`

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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `RequestModifier.Listener`
  Listener related to `RequestModifier` events

- ## 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` - If an error occurs while modifying the request