src/HttpRequest.php
protected function setJSONPayload($vars) {
    $this->headers['Content-Type'] = 'application/json';
    $this->headers['Content-Length'] = 0;
    $this->headers['Expect'] = '';

    if (!empty($vars)) {
      $data = json_encode($vars);
      $this->headers['Content-Length'] = strlen($data);
      curl_setopt($this->request, CURLOPT_POSTFIELDS, $data);
    }
  }
protected function setJSONPayload($vars) {
    $this->headers['Content-Type'] = 'application/json';
    $this->headers['Content-Length'] = 0;
    $this->headers['Expect'] = '';

    if (!empty($vars)) {
      $data = json_encode($vars);
      $this->headers['Content-Length'] = strlen($data);
      curl_setopt($this->request, CURLOPT_POSTFIELDS, $data);
    }
  }
protected function setJSONPayload ( $ vars ) { $ this -> headers [ 'Content-Type' ] = 'application/json' ; $ this -> headers [ 'Content-Length' ] = 0 ; $ this -> headers [ 'Expect' ] = '' ; if ( ! empty ( $ vars ) ) { $ data = json_encode ( $ vars ) ; $ this -> headers [ 'Content-Length' ] = strlen ( $ data ) ; curl_setopt ( $ this -> request , CURLOPT_POSTFIELDS , $ data ) ; } }
Set the JSON payload

@param array $vars
Set the JSON payload