Skip to content

Commit 9dda948

Browse files
committed
update README
1 parent 2d4eb75 commit 9dda948

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ return [
4141

4242
使用
4343
----
44-
44+
45+
v1.0
4546
```php
4647
use xutl\qcloud\Qcloud;
4748

@@ -55,6 +56,35 @@ $package = [
5556
print_r($wenzhi->TextKeywords($package));
5657
```
5758

59+
v2.0 使用方法
60+
```php
61+
use xutl\qcloud\Qcloud;
62+
63+
/** var Qcloud $qcloud */
64+
$qcloud = Yii::$app->qcloud;
65+
/** @var \yii\httpclient\Response $response */
66+
$response = $qcloud->createRequest(QCloud::API_CNS)->setData(['Action'=>'DomainList',])->send();;
67+
print_r($response->data);
68+
```
69+
70+
v2.0 使用方法 2 ,适用于没有内置的接口,通过此方法来请求。
71+
```php
72+
use xutl\qcloud\Client;
73+
74+
/** var Client $client */
75+
$request = (new Client([
76+
'serverHost' => 'cns.api.qcloud.com',
77+
'secretId' => '123456',
78+
'secretKey' => '654321',
79+
'region' => null
80+
]))
81+
->createRequest();
82+
83+
/** @var \yii\httpclient\Response $response */
84+
$response = $request->setMethod('POST')->setData(['Action'=>'DomainList',])->send();;
85+
print_r($response->data);
86+
```
87+
5888
资源
5989
-----
6090

0 commit comments

Comments
 (0)