HTTPリクエスト
POSTでファイル送信
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import requestsstr_data1 = '12345678'str_data2 = 'abcdefgh'file_path = 'C:\\path\\to\\file1.png'data = {'str_data1': str_data1, 'str_data2': str_data2}file = {'file': open(file_path, 'rb')}res = requests.post(url, files=file, data=data)print(res)print(res.text) |

