用GET方法上传文件

import requests #需要安装requests

with open('test.txt', 'rb') as f:
    requests.get('http://127.0.0.1:9999', data=f)

编程技巧