protected function req($url, $method = 'GET', $jsonDecode = TRUE, $body = '') {
    $client = \HPCloud\Transport::instance();
    $headers = array(
        'X-Auth-Token' => $this->token(),
    );

    $raw = $client->doRequest($url, $method, $headers, $body);
    if (!$jsonDecode) {
      return $raw;
    }
    return json_decode($raw->content(), TRUE);

  }
protected function req($url, $method = 'GET', $jsonDecode = TRUE, $body = '') {
    $client = \HPCloud\Transport::instance();
    $headers = array(
        'X-Auth-Token' => $this->token(),
    );

    $raw = $client->doRequest($url, $method, $headers, $body);
    if (!$jsonDecode) {
      return $raw;
    }
    return json_decode($raw->content(), TRUE);

  }
protected function req ( $ url , $ method = 'GET' , $ jsonDecode = TRUE , $ body = '' ) { $ client = \ HPCloud \ Transport :: instance ( ) ; $ headers = array ( 'X-Auth-Token' => $ this -> token ( ) , ) ; $ raw = $ client -> doRequest ( $ url , $ method , $ headers , $ body ) ; if ( ! $ jsonDecode ) { return $ raw ; } return json_decode ( $ raw -> content ( ) , TRUE ) ; }
Internal request issuing command.
Internal request issuing command .