Index: /trunk/include/iprt/http.h
===================================================================
--- /trunk/include/iprt/http.h	(revision 74059)
+++ /trunk/include/iprt/http.h	(revision 74060)
@@ -294,15 +294,22 @@
 RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, size_t cHeaders, const char * const *papszHeaders);
 
-/**
- * Appends a raw header.
+/** @name RTHTTPADDHDR_F_XXX - Flags for RTHttpAddRawHeader and RTHttpAddHeader
+ * @{ */
+#define RTHTTPADDHDR_F_BACK     UINT32_C(0) /**< Append the header. */
+#define RTHTTPADDHDR_F_FRONT    UINT32_C(1) /**< Prepend the header. */
+/** @} */
+
+/**
+ * Adds a raw header.
  *
  * @returns IPRT status code.
  * @param   hHttp           The HTTP client handle.
  * @param   pszHeader       Header string on the form "foo: bar".
- */
-RTR3DECL(int) RTHttpAppendRawHeader(RTHTTP hHttp, const char *pszHeader);
-
-/**
- * Appends a header field and value.
+ * @param   fFlags          RTHTTPADDHDR_F_FRONT or RTHTTPADDHDR_F_BACK.
+ */
+RTR3DECL(int) RTHttpAddRawHeader(RTHTTP hHttp, const char *pszHeader, uint32_t fFlags);
+
+/**
+ * Adds a header field and value.
  *
  * @returns IPRT status code.
@@ -310,7 +317,9 @@
  * @param   pszField        The header field name.
  * @param   pszValue        The header field value.
- * @param   fFlags          Flags reserved for controlling encoding, MBZ.
- */
-RTR3DECL(int) RTHttpAppendHeader(RTHTTP hHttp, const char *pszField, const char *pszValue, uint32_t fFlags);
+ * @param   fFlags          Only RTHTTPADDHDR_F_FRONT or RTHTTPADDHDR_F_BACK,
+ *                          may be extended with encoding controlling flags if
+ *                          needed later.
+ */
+RTR3DECL(int) RTHttpAddHeader(RTHTTP hHttp, const char *pszField, const char *pszValue, uint32_t fFlags);
 
 /**
Index: /trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBaseOci.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBaseOci.cpp	(revision 74059)
+++ /trunk/src/VBox/Runtime/common/rest/RTCRestClientApiBaseOci.cpp	(revision 74060)
@@ -146,5 +146,5 @@
         RTStrPrintf(szTmp, sizeof(szTmp), "%zu", a_rStrXmitBody.length());
 
-        rc = RTHttpAppendHeader(a_hHttp, s_szContentLength, szTmp, 0);
+        rc = RTHttpAddHeader(a_hHttp, s_szContentLength, szTmp, RTHTTPADDHDR_F_BACK);
         AssertRCReturn(rc, rc);
         pszContentLength = RTHttpGetHeader(a_hHttp, RT_STR_TUPLE(s_szContentLength));
@@ -177,5 +177,5 @@
         rc = RTBase64EncodeEx(abHash, sizeof(abHash), RTBASE64_FLAGS_NO_LINE_BREAKS, szTmp, sizeof(szTmp), NULL);
 
-        rc = RTHttpAppendHeader(a_hHttp, s_szXContentSha256, szTmp, 0);
+        rc = RTHttpAddHeader(a_hHttp, s_szXContentSha256, szTmp, RTHTTPADDHDR_F_BACK);
         AssertRCReturn(rc, rc);
         pszValue = RTHttpGetHeader(a_hHttp, RT_STR_TUPLE(s_szXContentSha256));
@@ -223,5 +223,5 @@
                     Time.u8Hour, Time.u8Minute, Time.u8Second);
 
-        rc = RTHttpAppendHeader(a_hHttp, s_szXDate, szTmp, 0);
+        rc = RTHttpAddHeader(a_hHttp, s_szXDate, szTmp, RTHTTPADDHDR_F_BACK);
         AssertRCReturn(rc, rc);
         pszXDate = RTHttpGetHeader(a_hHttp, RT_STR_TUPLE(s_szXDate));
@@ -304,5 +304,5 @@
                                      * Finally, add the authorization header.
                                      */
-                                    rc = RTHttpAppendHeader(a_hHttp, "Authorization", strAuth.c_str(), 0);
+                                    rc = RTHttpAddHeader(a_hHttp, "Authorization", strAuth.c_str(), RTHTTPADDHDR_F_FRONT);
                                     AssertRC(rc);
                                 }
Index: /trunk/src/VBox/Runtime/common/rest/RTCRestClientRequestBase.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/rest/RTCRestClientRequestBase.cpp	(revision 74059)
+++ /trunk/src/VBox/Runtime/common/rest/RTCRestClientRequestBase.cpp	(revision 74060)
@@ -193,5 +193,5 @@
                 AssertRCReturn(rc, rc);
 
-                rc = RTHttpAppendHeader(a_hHttp, a_paHeaderParams[i].pszName, strTmpVal.c_str(), 0);
+                rc = RTHttpAddHeader(a_hHttp, a_paHeaderParams[i].pszName, strTmpVal.c_str(), RTHTTPADDHDR_F_BACK);
                 AssertRCReturn(rc, rc);
             }
@@ -217,5 +217,5 @@
                     AssertRCReturn(rc, rc);
 
-                    rc = RTHttpAppendHeader(a_hHttp, strTmpName.c_str(), strTmpVal.c_str(), 0);
+                    rc = RTHttpAddHeader(a_hHttp, strTmpName.c_str(), strTmpVal.c_str(), RTHTTPADDHDR_F_BACK);
                     AssertRCReturn(rc, rc);
                 }
Index: /trunk/src/VBox/Runtime/generic/http-curl.cpp
===================================================================
--- /trunk/src/VBox/Runtime/generic/http-curl.cpp	(revision 74059)
+++ /trunk/src/VBox/Runtime/generic/http-curl.cpp	(revision 74060)
@@ -1929,5 +1929,5 @@
 
 /**
- * Helper for RTHttpSetHeaders and RTHttpAppendHeader that unsets the user agent
+ * Helper for RTHttpSetHeaders and RTHttpAddRawHeader that unsets the user agent
  * if it is now in one of the headers.
  */
@@ -1967,5 +1967,5 @@
 
     /*
-     * Convert the headers into a curl string list, checkig each string for User-Agent.
+     * Convert the headers into a curl string list, checking each string for User-Agent.
      */
     struct curl_slist *pHeaders = NULL;
@@ -2000,8 +2000,10 @@
 
 
-RTR3DECL(int) RTHttpAppendRawHeader(RTHTTP hHttp, const char *pszHeader)
+RTR3DECL(int) RTHttpAddRawHeader(RTHTTP hHttp, const char *pszHeader, uint32_t fFlags)
 {
     PRTHTTPINTERNAL pThis = hHttp;
     RTHTTP_VALID_RETURN(pThis);
+    AssertReturn(!(fFlags & ~RTHTTPADDHDR_F_BACK), VERR_INVALID_FLAGS);
+/** @todo implement RTHTTPADDHDR_F_FRONT */
 
     /*
@@ -2040,5 +2042,5 @@
 
 
-RTR3DECL(int) RTHttpAppendHeader(RTHTTP hHttp, const char *pszField, const char *pszValue, uint32_t fFlags)
+RTR3DECL(int) RTHttpAddHeader(RTHTTP hHttp, const char *pszField, const char *pszValue, uint32_t fFlags)
 {
 
@@ -2062,5 +2064,5 @@
     size_t const cchValue = strlen(pszValue);
 
-    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
+    AssertReturn(!(fFlags & ~RTHTTPADDHDR_F_BACK), VERR_INVALID_FLAGS);
 
     /*
@@ -2084,5 +2086,5 @@
     pszHeader[cbNeeded - 1] = '\0';
 
-    int rc = RTHttpAppendRawHeader(hHttp, pszHeader);
+    int rc = RTHttpAddRawHeader(hHttp, pszHeader, fFlags & RTHTTPADDHDR_F_FRONT);
 
     if (pszHeaderFree)
