Interface JavaHTTPInterceptor
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.network.http.HTTPInterceptor
public interface JavaHTTPInterceptor implements HTTPInterceptor
An HTTPInterceptor adapter that uses Java-style callbacks instead.
-
-
Method Summary
Modifier and Type Method Description abstract Unit
onRequestAsync(InterceptableHTTPRequest request, JavaCallback<Void> callback)
Intercepts an HTTP request before opening the connection, optionally modifying the request. abstract Unit
onResponseAsync(InterceptableHTTPResponse response, JavaCallback<Void> callback)
Intercepts an HTTP response before receiving the response bode, optionally modifying the response. Unit
onRequest(InterceptableHTTPRequest request)
Intercepts an HTTP request before opening the connection, optionally modifying the request. Unit
onResponse(InterceptableHTTPResponse response)
Intercepts an HTTP response before consuming the response body, optionally modifying the response. -
-
Method Detail
-
onRequestAsync
abstract Unit onRequestAsync(InterceptableHTTPRequest request, JavaCallback<Void> callback)
Intercepts an HTTP request before opening the connection, optionally modifying the request.
After the given callback is called, the given request can no longer be modified.
- Parameters:
request
- The mutable HTTP requestcallback
- A callback that must be called when this method is done
-
onResponseAsync
abstract Unit onResponseAsync(InterceptableHTTPResponse response, JavaCallback<Void> callback)
Intercepts an HTTP response before receiving the response bode, optionally modifying the response.
After the given callback is called, the given response can no longer be modified.
- Parameters:
response
- The mutable HTTP responsecallback
- A callback that must be called when this method is done
-
onRequest
Unit onRequest(InterceptableHTTPRequest request)
Intercepts an HTTP request before opening the connection, optionally modifying the request.
After this method returns, the given request can no longer be modified.
- Parameters:
request
- The mutable HTTP request
-
onResponse
Unit onResponse(InterceptableHTTPResponse response)
Intercepts an HTTP response before consuming the response body, optionally modifying the response.
After this method returns, the given response can no longer be modified.
- Parameters:
response
- The mutable HTTP response
-
-
-
-