我想将此代码转换为使用 python3 并使用 python-requests。 请帮帮我
import unirest
response = unirest.post("https://api.pixhost.to/images",
headers={
"Content-Type": "multipart/form-data; charset=utf-8",
"Accept": "application/json"
},
params={
"img": open("image.jpg", mode="r"),
"content_type": "0",
"max_th_size": "420"
}
)
答案 0 :(得分:0)
import requests
headers={"Content-Type": "multipart/form-data; charset=utf-8","Accept":"application/json"}
params={"img": open("image.jpg", mode="r"),"content_type": "0","max_th_size": "420"}
response = requests.post("https://api.pixhost.to/images", headers=headers, data=params)