Created
June 12, 2017 04:04
-
-
Save imfht/eeba5329ec41fb6506927908a0114fef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding = utf-8 | |
import json | |
import base64 | |
import requests | |
# 打开图片文件 | |
requests.adapters.DEFAULT_RETRIES = 5 | |
# 用base64编码图片文件 | |
headd = { | |
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36", | |
} | |
# 打开网站post | |
url = "http://stu.iplant.cn/upload.ashx" | |
url2 = "http://159.226.89.96:24606/plt5k" | |
r = requests.post(url, files = {"file1" : open('/tmp/1.jpg', 'rb')},headers = headd) | |
print('--') | |
print(r.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
result: