File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,31 @@ $client = new Client('你的token');
26
26
# 开始请求
27
27
$result = $client->setApi('/api/url')
28
28
->setParam('url','https://www.alapi.cn') # 设置请求参数,设置多个参数可以调用多次这个方法
29
- ->setParam('type','tcn') # 目前不支持直接上传文件等,上传图片请使用 base64
29
+ ->setParam('type','tcn') #
30
30
->throw() # 如果返回 code 不等于 200 则抛异常,不调用这个方法则不会抛异常
31
31
->request(); # 请求
32
32
33
33
var_dump($result);
34
34
var_dump($result->getData()); # 获取请求数据
35
35
```
36
+ ``` php
37
+ # 添加文件上传
38
+ use ALAPI\Client;
39
+
40
+ $client = new Client('你的token');
41
+
42
+ # 开始请求
43
+ $result = $client->setApi('/api/image')
44
+ ->setParam('image','文件路径',true) # 第二个参数是文件路径,第三个参数是否为文件
45
+ ->setParam('type','alapi') #
46
+ ->throw() # 如果返回 code 不等于 200 则抛异常,不调用这个方法则不会抛异常
47
+ ->request(); # 请求
48
+
49
+ var_dump($result);
50
+ var_dump($result->getData()); # 获取请求数据
51
+
52
+ ```
53
+
54
+ ## 接口文档地址
36
55
56
+ ALAPI 接口文档地址:[ https://www.alapi.cn ] ( https://www.alapi.cn )
You can’t perform that action at this time.
0 commit comments