我正在尝试查询 vTiger,但我使用的是 httpful,所以这是我的代码:
// vTiger: GET Query
// http://vtiger_url/webservice.php?operation=query&sessionName=[session id]&query=[query string]
$query = "SELECT * FROM Surveys;";
$uri = $vTiger_uri . "?operation=query&sessionName=" . $sessionName . "&query=" . $query;
$response_j = \Httpful\Request::get($uri)->send();
$response = json_decode($response_j, true);
echo "<p>Query: " . $query . "</p>";
echo "<pre>";
print_r($response);
echo "</pre>";
我得到了这个:
Array
(
[success] =>
[error] => Array
(
[code] => ACCESS_DENIED
[message] => Permission to perform the operation is denied for query
)
)
我担心我遗漏了一些非常简单的东西,但是在检查了涉及 Zend 和 Curl 的答案后,我无法弄清楚为什么它不适用于 httpful,这与编码查询字符串有关吗?:-(