Mercurial > minori
comparison src/core/http.cc @ 100:f5940a575d83
track/constants: add many more video formats
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Fri, 03 Nov 2023 09:43:04 -0400 |
| parents | 9b2b41f83a5e |
| children | 9b10175be389 |
comparison
equal
deleted
inserted
replaced
| 99:503bc1547d49 | 100:f5940a575d83 |
|---|---|
| 11 static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userdata) { | 11 static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userdata) { |
| 12 reinterpret_cast<QByteArray*>(userdata)->append(reinterpret_cast<char*>(contents), size * nmemb); | 12 reinterpret_cast<QByteArray*>(userdata)->append(reinterpret_cast<char*>(contents), size * nmemb); |
| 13 return size * nmemb; | 13 return size * nmemb; |
| 14 } | 14 } |
| 15 | 15 |
| 16 QByteArray Get(std::string url, std::vector<std::string> headers) { | 16 QByteArray Get(const std::string& url, const std::vector<std::string>& headers) { |
| 17 struct curl_slist* list = NULL; | 17 struct curl_slist* list = NULL; |
| 18 QByteArray userdata; | 18 QByteArray userdata; |
| 19 | 19 |
| 20 CURL* curl = curl_easy_init(); | 20 CURL* curl = curl_easy_init(); |
| 21 if (curl) { | 21 if (curl) { |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 return userdata; | 40 return userdata; |
| 41 } | 41 } |
| 42 | 42 |
| 43 QByteArray Post(std::string url, std::string data, std::vector<std::string> headers) { | 43 QByteArray Post(const std::string& url, const std::string& data, const std::vector<std::string>& headers) { |
| 44 struct curl_slist* list = NULL; | 44 struct curl_slist* list = NULL; |
| 45 QByteArray userdata; | 45 QByteArray userdata; |
| 46 | 46 |
| 47 CURL* curl = curl_easy_init(); | 47 CURL* curl = curl_easy_init(); |
| 48 if (curl) { | 48 if (curl) { |
