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');
2626# 开始请求
2727$result = $client->setApi('/api/url')
2828 ->setParam('url','https://www.alapi.cn') # 设置请求参数,设置多个参数可以调用多次这个方法
29- ->setParam('type','tcn') # 目前不支持直接上传文件等,上传图片请使用 base64
29+ ->setParam('type','tcn') #
3030 ->throw() # 如果返回 code 不等于 200 则抛异常,不调用这个方法则不会抛异常
3131 ->request(); # 请求
3232
3333var_dump($result);
3434var_dump($result->getData()); # 获取请求数据
3535```
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+ ## 接口文档地址
3655
56+ ALAPI 接口文档地址:[ https://www.alapi.cn ] ( https://www.alapi.cn )
You can’t perform that action at this time.
0 commit comments