@@ -41,8 +41,8 @@ public function __construct($defaultOptions = array())
4141 public function execute ($ requestMethod , $ url , $ parameters = null , $ extraOptions = array ())
4242 {
4343 $ customHeaders = array (
44- 'Content-Type: application/json;charset=UTF -8 ' ,
45- 'Accept: application/json;charset=UTF-8 ' ,
44+ 'Content-Type: application/json;charset=utf -8 ' ,
45+ 'Accept: application/json ' ,
4646 );
4747
4848 $ curl = curl_init ($ url );
@@ -56,7 +56,8 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
5656 if ($ parameters && is_array ($ parameters )) {
5757 curl_setopt ($ curl , CURLOPT_POSTFIELDS , json_encode ($ parameters ));
5858 } else {
59- $ customHeaders [] = 'Content-Length: 0 ' ;
59+ curl_setopt ($ curl , CURLOPT_POSTFIELDS , "{} " );
60+ $ customHeaders [] = 'Content-Length: 2 ' ;
6061
6162 // Suppress "Transfer-Encoding: chunked" header automatically added by cURL that
6263 // causes a 400 bad request (bad content-length).
@@ -78,7 +79,8 @@ public function execute($requestMethod, $url, $parameters = null, $extraOptions
7879 if ($ parameters && is_array ($ parameters )) {
7980 curl_setopt ($ curl , CURLOPT_POSTFIELDS , json_encode ($ parameters ));
8081 } else {
81- $ customHeaders [] = 'Content-Length: 0 ' ;
82+ curl_setopt ($ curl , CURLOPT_POSTFIELDS , "{} " );
83+ $ customHeaders [] = 'Content-Length: 2 ' ;
8284
8385 // Suppress "Transfer-Encoding: chunked" header automatically added by cURL that
8486 // causes a 400 bad request (bad content-length).
0 commit comments