I suspect that what this is doing and what you think it is doing are two different things, and further that the Content-Type header doesn’t match this clause.
Content-Type
Review PHP: curl_setopt - Manual