cpr icon indicating copy to clipboard operation
cpr copied to clipboard

Support for custom verbs

Open GitSparTV opened this issue 1 year ago • 1 comments

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

GitSparTV avatar Oct 11 '24 11:10 GitSparTV

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.

COM8 avatar Oct 18 '24 16:10 COM8