Allow to query HTTP headers

This commit is contained in:
Robin Gareus 2016-09-16 01:39:04 +02:00
parent 4042c234b1
commit 0996656ecc
2 changed files with 26 additions and 0 deletions

View file

@ -21,6 +21,7 @@
#include <curl/curl.h>
#include <string>
#include <map>
namespace ArdourCurl {
@ -35,6 +36,10 @@ class HttpGet {
size_t size;
};
struct HeaderInfo {
std::map<std::string, std::string> h;
};
char* get (const char* url);
std::string get (const std::string& url) {
@ -47,6 +52,8 @@ class HttpGet {
long int status () const { return _status; }
std::map<std::string, std::string> header () const { return nfo.h; }
char* escape (const char* s, int l) const {
return curl_easy_escape (_curl, s, l);
}
@ -76,6 +83,7 @@ class HttpGet {
char error_buffer[CURL_ERROR_SIZE];
struct MemStruct mem;
struct HeaderInfo nfo;
static const char* ca_path;
static const char* ca_info;