public function requestJson($method, $url, $options=array()){
        $options['headers'][] = 'Content-Type: application/json';
        $options['headers'][] = 'Content-Length: ' . strlen($options['body']);
        $this->request($method, $url, $options);
    }
public function requestJson($method, $url, $options=array()){
        $options['headers'][] = 'Content-Type: application/json';
        $options['headers'][] = 'Content-Length: ' . strlen($options['body']);
        $this->request($method, $url, $options);
    }
public function requestJson ( $ method , $ url , $ options = array ( ) ) { $ options [ 'headers' ] [ ] = 'Content-Type: application/json' ; $ options [ 'headers' ] [ ] = 'Content-Length: ' . strlen ( $ options [ 'body' ] ) ; $ this -> request ( $ method , $ url , $ options ) ; }
request as body data is json
if you want to request Json, set Content-Type and Length;
request as body data is json if you want to request Json set Content - Type and Length ;