Python的API调用 #168
Unanswered
HeXiaoteng
asked this question in
问答
Replies: 1 comment
-
import requests
url = "https://png.cm/api/index.php"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"token\"\r\n\r\n8337effca0ddfcd9c5899f3509b23657\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\n195124.jpg\r\n-----011000010111000001101001--\r\n\r\n"
headers = {"content-type": "multipart/form-data; boundary=---011000010111000001101001"}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text) 仅供参考,我不太会Python |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
看不懂帮助文档中怎么调用的,
payload ="-----011000010111000001101001\r\nContent-Disposition: form-data; name="token"\r\n\r\n8337effca0ddfcd9c5899f3509b23657\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name="image"\r\n\r\n195124.jpg\r\n-----011000010111000001101001--\r\n\r\n"
我修改了8337effca0ddfcd9c5899f3509b23657为自己的token,修改了195124.jpg为自己的图片地址,结果返回204,我应该怎么修改呢,有大佬可以给一个示例吗
Beta Was this translation helpful? Give feedback.
All reactions