Implement an API to use HTTP extensions like CalDAV I want to create a calDAV API endpoint. The client would contact my API using methods mentioned in the sabre DAV client documentation https://sabre.io/dav/building-a-caldav-client/ (sabre dav seems to be used by alot of projects so I am using it as a protocol documentation).
Now I am completely lost how to implement that in Drupal. There was a webDAV module but it's abandoned for 4 years and a calDAV module that's abandoned for 9 years...
Can I use REST API and hook it to respond to HTTP request methods like PROPFIND?
I solved this.
I added method to the route and @Method({'PROPFIND'}) to the source (I am not sure if this is needed for Symfony).
class DavController extends ControllerBase {

/**     
 * @Method({&quot;PROPFIND&quot;})       
 */
 public function dav() {
     //Get the data, fill into xml twig

        $response = new Response();
        $xml = \Drupal::service('renderer')-&gt;renderRoot($build);
        $response-&gt;setContent($xml);
        $response-&gt;headers-&gt;set('Content-Type', 'application/xml');

        return $response
 }

module_name.routing.yml (this seems to be mandatory):
    entity.dav_controller.dav:
        path: 'path/to/dav/enpoint'
        methods: [PROPFIND]
        defaults:
            _controller: '\Drupal\path\to\DavController::dav'
            _title: 'my_title'
        requirements: 
            _permission: 'access content'

This works in 8 and 9.
Note that this does not involve the Drupal REST API. This is supposed to be an own implementation and won't solve the issue for anyone who wants to use REST API to answer to such methods. I am not experienced enough with Drupal to explain if and how one could configure REST API to accept HTTP methods not listed in the REST API documentation. Maybe one could extend own controllers from the REST API, but I didn't inquire into how to do that.