Implement all aisv3 HTTP requests. Added PATCH and COPY methods.

This commit is contained in:
Shyotl
2015-07-23 01:02:02 -05:00
parent 2b9245ba2e
commit dedd75dc4f
16 changed files with 1456 additions and 80 deletions

View File

@@ -803,6 +803,23 @@ void CurlEasyRequest::setPut(U32 size, bool keepalive)
setopt(CURLOPT_INFILESIZE, size);
}
void CurlEasyRequest::setPatch(U32 size, bool keepalive)
{
DoutCurl("PATCH size is " << size << " bytes.");
mContentLength = size;
// The server never replies with 100-continue, so suppress the "Expect: 100-continue" header that libcurl adds by default.
addHeader("Expect:");
if (size > 0 && keepalive)
{
addHeader("Connection: keep-alive");
addHeader("Keep-alive: 300");
}
setopt(CURLOPT_UPLOAD, 1);
setopt(CURLOPT_INFILESIZE, size);\
setopt(CURLOPT_CUSTOMREQUEST, "PATCH");
}
void CurlEasyRequest::setPost(AIPostFieldPtr const& postdata, U32 size, bool keepalive)
{
llassert_always(postdata->data());