本文整理汇总了PHP中HttpClient::addQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpClient::addQuery方法的具体用法?PHP HttpClient::addQuery怎么用?PHP HttpClient::addQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient::addQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _remoteCall
protected function _remoteCall($method, $params = null)
{
$uri = $this->reportServer;
$cache_id = md5($this->objectName . $uri . $method . serialize($params));
$cacheSvc = Openbiz::getService(CACHE_SERVICE, 1);
$cacheSvc->init($this->objectName, $this->cacheLifeTime);
if (substr($uri, strlen($uri) - 1, 1) != '/') {
$uri .= '/';
}
$uri .= "ws.php/udc/CollectService";
if ($cacheSvc->test($cache_id) && (int) $this->cacheLifeTime > 0) {
$resultSetArray = $cacheSvc->load($cache_id);
} else {
try {
$argsJson = urlencode(json_encode($params));
$query = array("method={$method}", "format=json", "argsJson={$argsJson}");
$httpClient = new HttpClient('POST');
foreach ($query as $q) {
$httpClient->addQuery($q);
}
$headerList = array();
$out = $httpClient->fetchContents($uri, $headerList);
$cats = json_decode($out, true);
$resultSetArray = $cats['data'];
$cacheSvc->save($resultSetArray, $cache_id);
} catch (Exception $e) {
$resultSetArray = array();
}
}
return $resultSetArray;
}
示例2: testSvc
function testSvc($url, $query = null, $cookie = null)
{
$httpClient = new HttpClient('POST');
$httpClient->setCookie($cookie);
foreach ($query as $q) {
$httpClient->addQuery($q);
}
$headerList = array();
$out = $httpClient->fetchContents($url, $headerList, false);
return $out;
}
示例3: acquireLicense
public function acquireLicense($activationCode, $contactEmail, $serverData)
{
//try to process cache service.
$argsJson = json_encode(array("activation_code" => $activationCode, "contact_email" => $contactEmail, "server_data" => $serverData));
$query = array("method=acquireLicense", "format=json", "argsJson={$argsJson}");
$httpClient = new HttpClient('POST');
foreach ($query as $q) {
$httpClient->addQuery($q);
}
$headerList = array();
$out = $httpClient->fetchContents($this->repositoryUrl, $headerList);
echo $out;
$lic = json_decode($out, true);
$licenseArray = $lic['data'];
return $licenseArray;
}
示例4: GetSystemUUIDfromRemote
public function GetSystemUUIDfromRemote()
{
$method = "CetSystemUUID";
if (function_exists("ioncube_server_data")) {
$system_server_data = ioncube_server_data();
} else {
$system_server_data = "";
}
$params = array("system_server_data" => $system_server_data);
$argsJson = urlencode(json_encode($params));
$query = array("method={$method}", "format=json", "argsJson={$argsJson}");
$httpClient = new HttpClient('POST');
foreach ($query as $q) {
$httpClient->addQuery($q);
}
$headerList = array();
$out = $httpClient->fetchContents($this->m_UDC_Server, $headerList);
$cats = json_decode($out, true);
$result = $cats['data'];
if ($result) {
$dataFile = APP_HOME . '/files/system_uuid.data';
file_put_contents($dataFile, $result);
}
return $result;
}