图片上传
https://chat-go.jwzhd.com/open-apis/v1/image/upload?token=xxxxxxxxxx
POST
curl --location 'https://chat-go.jwzhd.com/open-apis/v1/image/upload?token=xxxxxxxxxx' \--form 'image=@"D:\\image\\aaa\\bbb.png"'Content-Type: "multipart/form-data;"| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| image | file | 是 | 图片内容,仅限单个图片,上传图片大小不超过 10MB |
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 响应代码 |
| msg | string | 响应信息,包括异常信息 |
| data | Object | 返回数据 |
图片上传响应示例
Section titled “图片上传响应示例”{ "code": 1, "data": { "imageKey": "xxxxxxxxxxxx" }, "msg": "success"}Python 代码示例
Section titled “Python 代码示例”import requests
url = "https://chat-go.jwzhd.com/open-apis/v1/image/upload?token=xxxxxx"
files=[ ('image',open('6bca4389875743205502a57bb90fcad0.gif','rb'))]
response = requests.request("POST", url, files=files)print(response.text)