Interface InterceptableHTTPRequest
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.network.http.HTTPRequest
public interface InterceptableHTTPRequest implements HTTPRequest
An HTTP request that can be intercepted using HTTPInterceptor.onRequest.
-
-
Method Summary
Modifier and Type Method Description abstract Unit
respondWith(CompleteHTTPResponse response)
Immediately respond with the provided response. abstract String
getMethod()
The mutable method for the URL request, one of:"GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE" abstract Unit
setMethod(String method)
The mutable method for the URL request, one of:"GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE" abstract URL
getUrl()
The mutable URL to perform the request to. abstract Unit
setUrl(URL url)
The mutable URL to perform the request to. abstract Map<String, String>
getHeaders()
The mutable request headers to be used during the request. abstract Unit
setHeaders(Map<String, String> headers)
The mutable request headers to be used during the request. abstract ByteArray
getBody()
The mutable request body to be used during a POST or PUT request. abstract Unit
setBody(ByteArray body)
The mutable request body to be used during a POST or PUT request. abstract Integer
getConnectTimeout()
The connection timeout in milliseconds. abstract Unit
setConnectTimeout(Integer connectTimeout)
The connection timeout in milliseconds. abstract Integer
getReadTimeout()
The read timeout in milliseconds. abstract Unit
setReadTimeout(Integer readTimeout)
The read timeout in milliseconds. -
-
Method Detail
-
respondWith
abstract Unit respondWith(CompleteHTTPResponse response)
Immediately respond with the provided response.
-
getMethod
abstract String getMethod()
The mutable method for the URL request, one of:
"GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"
-
setMethod
abstract Unit setMethod(String method)
The mutable method for the URL request, one of:
"GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"
-
getHeaders
abstract Map<String, String> getHeaders()
The mutable request headers to be used during 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 request headers to be used during 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"
-
getBody
abstract ByteArray getBody()
The mutable request body to be used during a POST or PUT request.
-
setBody
abstract Unit setBody(ByteArray body)
The mutable request body to be used during a POST or PUT request.
-
getConnectTimeout
abstract Integer getConnectTimeout()
The connection timeout in milliseconds. This timeout is used when establishing a connection to a remote server. If the connection cannot be established within this timeout period, a connection timeout error will be thrown.
-
setConnectTimeout
abstract Unit setConnectTimeout(Integer connectTimeout)
The connection timeout in milliseconds. This timeout is used when establishing a connection to a remote server. If the connection cannot be established within this timeout period, a connection timeout error will be thrown.
-
getReadTimeout
abstract Integer getReadTimeout()
The read timeout in milliseconds. This timeout is used when reading data from an established connection with a remote server. If no data is received within this timeout period, a read timeout error will be thrown.
-
setReadTimeout
abstract Unit setReadTimeout(Integer readTimeout)
The read timeout in milliseconds. This timeout is used when reading data from an established connection with a remote server. If no data is received within this timeout period, a read timeout error will be thrown.
-
-
-
-