requests实现form表单文件上传 data = { "username": "test_user", 'nickname':"password" , } files = {'img': open("123.jpg", 'rb')} res = requests.post(url, data=data, files=files, headers=headers)