Implement all aisv3 HTTP requests. Added PATCH and COPY methods.
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user