将curl命令复制到python



我上传图片到imgbb.com网站,并使用firefox显示curl命令

curl "https://imgbb.com/json" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0" -H "Accept: application/json" -H "Accept-Language: en-US,en;q=0.5" --compressed -H "Content-Type: multipart/form-data; boundary=---------------------------270624834321652808912303071412" -H "Origin: https://imgbb.com" -H "Connection: keep-alive" -H "Referer: https://imgbb.com/" -H "Cookie: PHPSESSID=6o18hipgu8uk8orq4pg47of4b5; __gads=ID=40783678319bf866-227f347cf1a6003f:T=1614875864:RT=1614875864:S=ALNI_MbBjogRusDweg41MHFP01KawfJuiw" -H "DNT: 1" -H "Sec-GPC: 1" -H "TE: Trailers" --data-binary "-----------------------------270624834321652808912303071412"^
"Content-Disposition: form-data; name=""source""; filename=""test.png"""^
"Content-Type: image/png"^
""^
"-----------------------------270624834321652808912303071412"^
"Content-Disposition: form-data; name=""type"""^
""^
"file"^
"-----------------------------270624834321652808912303071412"^
"Content-Disposition: form-data; name=""action"""^
""^
"upload"^
"-----------------------------270624834321652808912303071412"^
"Content-Disposition: form-data; name=""timestamp"""^
""^
"1614875900988"^
"-----------------------------270624834321652808912303071412"^
"Content-Disposition: form-data; name=""auth_token"""^
""^
"e47e40461c19ef13a3768c45e2a0a5189f3bf625"^
"-----------------------------270624834321652808912303071412--"^
""

我可以看到我上传的test.png图片。

如何使用不同图片的python再次发送该命令?

可以使用在线curl到Pythonrequests生成器。

但是你应该使用imgBB API。

相关内容

  • 没有找到相关文章

最新更新