#include <http_key_fetcher.h>
|
Status | FetchKeys (const std::string &url, const std::string &request, std::string *response) override |
|
virtual Status | Get (const std::string &url, std::string *response) |
|
virtual Status | Post (const std::string &url, const std::string &data, std::string *response) |
|
A KeyFetcher implementation that retrieves keys over HTTP(s). This class is not fully thread safe. It can be used in multi-thread environment once constructed, but it may not be safe to create a HttpKeyFetcher object when any other thread is running due to use of curl_global_init.
Definition at line 25 of file http_key_fetcher.h.
◆ HttpKeyFetcher()
shaka::media::HttpKeyFetcher::HttpKeyFetcher |
( |
int32_t |
timeout_in_seconds | ) |
|
Create a fetcher with timeout.
- Parameters
-
timeout_in_seconds | specifies the timeout in seconds. |
Definition at line 27 of file http_key_fetcher.cc.
◆ FetchKeys()
Status shaka::media::HttpKeyFetcher::FetchKeys |
( |
const std::string & |
service_address, |
|
|
const std::string & |
request, |
|
|
std::string * |
response |
|
) |
| |
|
overridevirtual |
Fetch Keys from license service. |response| is owned by caller.
- Parameters
-
service_address | license service address. |
request | JSON formatted request. |
response | JSON formatted response. Owned by caller. |
- Returns
- OK on success.
Implements shaka::media::KeyFetcher.
Definition at line 32 of file http_key_fetcher.cc.
◆ Get()
Status shaka::media::HttpKeyFetcher::Get |
( |
const std::string & |
url, |
|
|
std::string * |
response |
|
) |
| |
|
virtual |
Fetch content using HTTP GET.
- Parameters
-
| url | specifies the content URL. |
[out] | response | will contain the body of the http response on success. It should not be NULL. |
- Returns
- OK on success.
Definition at line 38 of file http_key_fetcher.cc.
◆ Post()
Status shaka::media::HttpKeyFetcher::Post |
( |
const std::string & |
url, |
|
|
const std::string & |
data, |
|
|
std::string * |
response |
|
) |
| |
|
virtual |
Fetch content using HTTP POST.
- Parameters
-
| url | specifies the content URL. |
[out] | response | will contain the body of the http response on success. It should not be NULL. |
- Returns
- OK on success.
Definition at line 42 of file http_key_fetcher.cc.
The documentation for this class was generated from the following files: