Instead of curl I like to use http request function from a long and stable framework
PHP: http request function, alternative to curl or file_get_contents. Because I find curl to be tedious. Using this function it's easy to do all requests.
Source code viewer
require_once 'request.php'; 'method' => 'POST', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ), // ... json array )), )); Programming Language: PHP