Request

@objc(THEOplayerRequest)
public class Request : NSObject, Codable

A request, either for a CertificateRequest or a LicenseRequest.

  • url

    The URL for the certificate server. By default, this will equal the certificate URL configured in the KeySystemConfiguration`.

    Declaration

    Swift

    @objc
    public var url: String
  • The method of the HTTP request, for example: GET, POST or PUT.

    Remark

    • Will be equal to GET for Fairplay certificate requests and POST for Widevine certificate requests.
    • Will be equal to POST for all license requests.

    Declaration

    Swift

    @objc
    public var method: String
  • The HTTP request headers to be sent to the server.

    Declaration

    Swift

    @objc
    public var headers: [String : String]
  • The body of the certificate request.

    Remark

    • For GET requests (such as with Fairplay), the body will be empty (nil).
    • For POST requests (such as with Widevine): the body will contain the two bytes in an array as specified in the certificate request protocol.

    Declaration

    Swift

    @objc
    public var body: Data?
  • Creates a new HTTP request for the given URL.

    Declaration

    Swift

    @objc
    public init(url: String, method: String, headers: [String : String], body: Data?)

    Parameters

    url

    The URL of the license or certificate server.

    method

    The method of the HTTP request.

    headers

    The HTTP headers to be sent to the server.

    body

    The body of the request.