public function postJSON($url, $data = null)
    {
        $responseBody = $this->post($url, json_encode($data), 'application/json');

        return json_decode($responseBody);
    }
public function postJSON($url, $data = null)
    {
        $responseBody = $this->post($url, json_encode($data), 'application/json');

        return json_decode($responseBody);
    }
public function postJSON ( $ url , $ data = null ) { $ responseBody = $ this -> post ( $ url , json_encode ( $ data ) , 'application/json' ) ; return json_decode ( $ responseBody ) ; }
Make a POST request, sending JSON data.

@param string $url
@param $data

@return \stdClass
Make a POST request sending JSON data .