Interface InterceptableHTTPResponse
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.network.http.HTTPResponse
public interface InterceptableHTTPResponse implements HTTPResponse
An HTTP response that can be intercepted using HTTPInterceptor.onResponse.
-
-
Method Summary
Modifier and Type Method Description abstract Unit
onChunk(ChunkInterceptor chunkInterceptor)
Provides ByteArray chunks of the response body as they are read from the HTTP connection. abstract Unit
onBody(BodyInterceptor bodyInterceptor)
Provides the response body from the HTTP connection after passing through the onChunk. abstract URL
getUrl()
The mutable URL which was used to do the request to. abstract Unit
setUrl(URL url)
The mutable URL which was used to do the request to. abstract Map<String, String>
getHeaders()
The mutable response headers received from the request. abstract Unit
setHeaders(Map<String, String> headers)
The mutable response headers received from the request. abstract Integer
getStatus()
The mutable status code from the HTTP response message received from the request. abstract Unit
setStatus(Integer status)
The mutable status code from the HTTP response message received from the request. abstract String
getStatusText()
The mutable HTTP response message, if any, returned from a server. abstract Unit
setStatusText(String statusText)
The mutable HTTP response message, if any, returned from a server. -
-
Method Detail
-
onChunk
abstract Unit onChunk(ChunkInterceptor chunkInterceptor)
Provides ByteArray chunks of the response body as they are read from the HTTP connection.
Modifying the provided ByteArray or returning a new one will result to changes in the final body received in onBody.
-
onBody
abstract Unit onBody(BodyInterceptor bodyInterceptor)
Provides the response body from the HTTP connection after passing through the onChunk.
Modifying the provided ByteArray or returning a new one will result to changes in the behavior of the player.
-
getUrl
abstract URL getUrl()
The mutable URL which was used to do the request to.
Note that, in case of redirects it can be different from the original request URL.
-
setUrl
abstract Unit setUrl(URL url)
The mutable URL which was used to do the request to.
Note that, in case of redirects it can be different from the original request URL.
-
getHeaders
abstract Map<String, String> getHeaders()
The mutable response headers received from the request.
In case of multiple values per key, the values are comma separated.
Adding or overriding headers can be done by:
headers"newKey" = "newValue"
-
setHeaders
abstract Unit setHeaders(Map<String, String> headers)
The mutable response headers received from the request.
In case of multiple values per key, the values are comma separated.
Adding or overriding headers can be done by:
headers"newKey" = "newValue"
-
getStatus
abstract Integer getStatus()
The mutable status code from the HTTP response message received from the request.
From responses like HTTP/1.0 200 OK, extracts the number 200.
-
setStatus
abstract Unit setStatus(Integer status)
The mutable status code from the HTTP response message received from the request.
From responses like HTTP/1.0 200 OK, extracts the number 200.
-
getStatusText
abstract String getStatusText()
The mutable HTTP response message, if any, returned from a server.
From responses like HTTP/1.0 200 OK, extracts the Strings "OK".
Returns null if none could be discerned from the responses (the result was not valid HTTP).
-
setStatusText
abstract Unit setStatusText(String statusText)
The mutable HTTP response message, if any, returned from a server.
From responses like HTTP/1.0 200 OK, extracts the Strings "OK".
Returns null if none could be discerned from the responses (the result was not valid HTTP).
-
-
-
-