Fix LV2UI_Request_Parameter Feature URI
[ardour.git] / gtk2_ardour / ardour_http.h
index 06cf46f408751851827455363a7152330292189d..e209d75d9e4645127f7f170414777189426fff9b 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <curl/curl.h>
 #include <string>
+#include <map>
 
 namespace ArdourCurl {
 
@@ -35,10 +36,14 @@ class HttpGet {
                size_t size;
        };
 
-       char* get (const char* url);
+       struct HeaderInfo {
+               std::map<std::string, std::string> h;
+       };
+
+       char* get (const char* url, bool with_error_logging = false);
 
-       std::string get (const std::string& url) {
-               char *rv = get (url.c_str ());
+       std::string get (const std::string& url, bool with_error_logging = false) {
+               char *rv = get (url.c_str (), with_error_logging);
                return rv ? std::string (rv) : std::string ("");
        }
 
@@ -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,14 +83,16 @@ class HttpGet {
        char error_buffer[CURL_ERROR_SIZE];
 
        struct MemStruct mem;
+       struct HeaderInfo nfo;
 
        static const char* ca_path;
        static const char* ca_info;
 };
 
-char* http_get (const char* url, int* status);
+char* http_get (const char* url, int* status, bool with_error_logging);
+std::string http_get (const std::string& url, bool with_error_logging);
+
 
-std::string http_get (const std::string& url);
 
 } // namespace