Index: /trunk/include/iprt/http.h
===================================================================
--- /trunk/include/iprt/http.h	(revision 43712)
+++ /trunk/include/iprt/http.h	(revision 43713)
@@ -87,4 +87,15 @@
                              const char *pcszProxyUser, const char *pcszProxyPwd);
 
+
+/**
+ * Set custom headers.
+ *
+ * @returns iprt status code.
+ *
+ * @param    hHttp         HTTP interface handle.
+ * @param    cHeaders      number of custom headers.
+ * @param    pcszHeaders   array of headers in form "foo: bar".
+ */
+RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, uint32_t cHeaders, const char *pcszHeaders[]);
 /** @} */
 
Index: /trunk/src/VBox/Runtime/common/misc/http.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/misc/http.cpp	(revision 43712)
+++ /trunk/src/VBox/Runtime/common/misc/http.cpp	(revision 43713)
@@ -48,4 +48,5 @@
     CURL *pCurl;
     long lLastResp;
+    struct curl_slist *pHeaders;
 } RTHTTPINTERNAL;
 typedef RTHTTPINTERNAL *PRTHTTPINTERNAL;
@@ -116,4 +117,7 @@
 
     curl_easy_cleanup(pHttpInt->pCurl);
+        
+    if (pHttpInt->pHeaders)
+        curl_slist_free_all(pHttpInt->pHeaders);
 
     RTMemFree(pHttpInt);
@@ -169,4 +173,29 @@
 }
 
+RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, uint32_t cHeaders, const char *pcszHeaders[])
+{
+    PRTHTTPINTERNAL pHttpInt = hHttp;
+    RTHTTP_VALID_RETURN(pHttpInt);
+
+    if (!cHeaders)
+    {
+        if (pHttpInt->pHeaders)
+            curl_slist_free_all(pHttpInt->pHeaders);
+        pHttpInt->pHeaders = 0;
+        return VINF_SUCCESS;
+    }
+
+    struct curl_slist* pHeaders = NULL;
+    for (unsigned i = 0; i < cHeaders; i++)
+        pHeaders = curl_slist_append(pHeaders, pcszHeaders[i]);
+
+    pHttpInt->pHeaders = pHeaders;
+    int rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_HTTPHEADER, pHeaders);
+    if (CURL_FAILED(rcCurl))
+        return VERR_INVALID_PARAMETER;
+
+    return VINF_SUCCESS;
+}
+
 RTR3DECL(int) RTHttpGet(RTHTTP hHttp, const char *pcszUrl, char **ppszResponse)
 {
@@ -177,4 +206,10 @@
     if (CURL_FAILED(rcCurl))
         return VERR_INVALID_PARAMETER;
+
+#if 0
+    rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_VERBOSE, 1);
+    if (CURL_FAILED(rcCurl))
+        return VERR_INVALID_PARAMETER;
+#endif
 
     /* XXX */
