file
-
[python] 파이썬에서 requests로 파일 전송하기.Programing/python 2020. 11. 3. 13:21
import requests url = 'http://ENDPOINT/upload' headers = {'Content-Type': 'application/json; charset=utf-8'; 'i-access-token': TOKEN1; 'x-access-token': TOKEN2} data = {} files = {'images': open('test.jpg', 'rb')} res = requests.post(url, headers=headers, files=files)