Solved: The problem lies here:
I set POST
via both _CUSTOMREQUEST
and _POST
and the _CUSTOMREQUEST
persisted as POST
while _POST
switched to _HTTPGET
. The Server assumed the header from _CUSTOMREQUEST
to be the right one and came back with a 411.
curl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'POST');