Package com.castlabs.android.network
Class Request
java.lang.Object
com.castlabs.android.network.Request
A modifiable request. You can use an instance of this class in a
RequestModifier
to change the URI and HTTP headers. Please note that you can use Uri.Builder to
also modify the query parameters attached to the given URI.- Since:
- 4.1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceRepresents a request data type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRequest type for DASH callback requestsstatic final intRequest type for RTP/UDP requestsstatic final intRequest type for DRM license requestsstatic final intRequest type for DRM provisioning requestsstatic final intRequest type for manifest requestsstatic final intRequest type for other requestsstatic final intRequest type for segment requestsstatic final intRequest type for thumbnail requestsThe header parameters that will be applied to the request.final intThe request type. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new request with the given URI and no headersCreate a new request with the given URI and headersCreate a new request with the given URI and headers -
Method Summary
-
Field Details
-
DATA_TYPE_MANIFEST
public static final int DATA_TYPE_MANIFESTRequest type for manifest requests- See Also:
-
DATA_TYPE_SEGMENT
public static final int DATA_TYPE_SEGMENTRequest type for segment requests- See Also:
-
DATA_TYPE_OTHER
public static final int DATA_TYPE_OTHERRequest type for other requests- See Also:
-
DATA_TYPE_DRM_PROVISION
public static final int DATA_TYPE_DRM_PROVISIONRequest type for DRM provisioning requests- See Also:
-
DATA_TYPE_DRM_LICENSE
public static final int DATA_TYPE_DRM_LICENSERequest type for DRM license requests- See Also:
-
DATA_TYPE_DASH_CALLBACK
public static final int DATA_TYPE_DASH_CALLBACKRequest type for DASH callback requests- See Also:
-
DATA_TYPE_DATAGRAM
public static final int DATA_TYPE_DATAGRAMRequest type for RTP/UDP requests- See Also:
-
DATA_TYPE_THUMBNAIL
public static final int DATA_TYPE_THUMBNAILRequest type for thumbnail requests- See Also:
-
headers
The header parameters that will be applied to the request. Use this map to modify the headers. Note that keys and values should be not encoded. -
type
public final int typeThe request type. This is one ofDATA_TYPE_MANIFEST,DATA_TYPE_SEGMENT,DATA_TYPE_OTHER,DATA_TYPE_DRM_LICENSE, orDATA_TYPE_DRM_PROVISION
-
-
Constructor Details
-
Request
Create a new request with the given URI and no headers- Parameters:
type- The request type. This is one ofDATA_TYPE_MANIFEST,DATA_TYPE_SEGMENTorDATA_TYPE_OTHERuri- The URI. Null is not permitted.
-
Request
Create a new request with the given URI and headers- Parameters:
type- The request type. This is one ofDATA_TYPE_MANIFEST,DATA_TYPE_SEGMENTorDATA_TYPE_OTHERuri- The URI. Null is not permittedheaders- The headers
-
Request
public Request(int type, @NonNull Uri uri, @Nullable Map<String, String> headers, @Nullable byte[] data) Create a new request with the given URI and headers- Parameters:
type- The request type. This is one ofDATA_TYPE_MANIFEST,DATA_TYPE_SEGMENTorDATA_TYPE_OTHERuri- The URI. Null is not permittedheaders- The headersdata- The POST payload
-
-
Method Details
-
getUri
Get the request URI.- Returns:
- The request URI. Query parameters are not applied yet
-
setUri
Set the target URI for this request.nullis not permitted and will raise an exception.- Parameters:
uri- The URI. Null is not permitted
-
getData
@Nullable public byte[] getData()Get the data that will be send with a post request- Returns:
- The data or null
-
setData
public void setData(@Nullable byte[] data) Set the data that will be send with a post request- Parameters:
data- The data
-