cpr
cpr copied to clipboard
Support for custom verbs
Is your feature request related to a problem?
I'm using car for CalDAV client. CalDAV as a WebDAV variation uses different set of HTTP verbs such as:
- PROPFIND
- PROPPATCH
- MKCOL
- COPY
- MOVE
- LOCK
- UNLOCK
Not to mention we don't have all regular http verbs. See the list in Boost.
Possible Solution
Add a method to set custom verb or add all verbs.
Alternatives
The closest I can get without writing curl myself:
session.PrepareGet(); // Writes url and other options. I'm calling it because prepareCommon is private.
auto holder = session.GetCurlHolder();
curl_easy_setopt(holder->handle, CURLOPT_CUSTOMREQUEST, "PROPFIND");
const CURLcode curl_error = curl_easy_perform(holder->handle);
return session.Complete(curl_error);
Additional Context
No response
Would be interesting but right now there is now plan to add this functionality. But I would be more than happy to accept a PR adding this functionality.