Class Request


  • public class Request
    extends Object
    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
    • Constructor Detail

      • 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 of DATA_TYPE_MANIFEST, DATA_TYPE_SEGMENT or DATA_TYPE_OTHER
        uri - The URI. Null is not permitted
        headers - The headers
        data - The POST payload
    • Method Detail

      • getUri

        @NonNull
        public Uri getUri()
        Get the request URI.
        Returns:
        The request URI. Query parameters are not applied yet
      • setUri

        public void setUri​(@NonNull
                           Uri uri)
        Set the target URI for this request. null is 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