-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.php
30 lines (22 loc) · 882 Bytes
/
demo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
require 'vendor/autoload.php';
use QCLOUDAPI\QcloudApi;
$config = array('SecretId' => 'AKIDQoMIs3IgD9q36CvzC858pFZurCEot0uj',
'SecretKey' => 'XKolWU8DouLP5rDs0OzG2N6gktb36UXw',
'RequestMethod' => 'GET',
'DefaultRegion' => 'gz');
$cvm = QcloudApi::load(QcloudApi::MODULE_WENZHI, $config);
$package = array('text' =>'待词法分析的文本', 'Code ' => 'utf-8');
$a = $cvm->LexicalAnalysis($package);
// $a = $cvm->generateUrl('DescribeInstances', $package);
if ($a === false) {
$error = $cvm->getError();
echo "Error code:" . $error->getCode() . ".\n";
echo "message:" . $error->getMessage() . ".\n";
echo "ext:" . var_export($error->getExt(), true) . ".\n";
} else {
var_dump($a);
}
echo "\nRequest :" . $cvm->getLastRequest();
echo "\nResponse :" . $cvm->getLastResponse();
echo "\n";