libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.58k stars 935 forks source link

Support for custom verbs #1122

Open GitSparTV opened 1 month ago

GitSparTV commented 1 month ago

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:

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

COM8 commented 3 weeks ago

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.