I'm currently trying to write a wordpress plugin that connects to a caldav server and creates an .ics file from the calendar data. as a first step, I used https://uname.pingveno.net/blog/index.php/post/2016/07/30/Sample-public-calendar-for-ownCloud-using-ICS-parser as a starting point, which works ok. But the wordpress admins refuse to accept a plugin that uses plain curl, they recommend doing it all through the WP http API: https://developer.wordpress.org/plugins/http-api/ . I managed to connect to the caldav server through that API, but can't get the desired xml response, only plain html, which does not contain the calendar data as such, but a table of .ics files, which would then have to be parsed individually, not very elegant... The problem seems to be how to implement these 3 lines:
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'REPORT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
via the wp API, especially:
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'REPORT');
which does not seem to be possible via wp_remote_get() or wp_remote_post() . maybe anyone here got a hint for me ?