I am trying to represent the following curl statement in python:
curl --data-binary @sample.png --data project = 23423233 -H 'X-API-KEY: YOUR API KEY, User-Agent: AppName ([email protected])' https://files.proofhub.com/files/upload
I have already done multiple post & get requests, however since this one uses the data option, I cannot get my head around how I would execute this using requests.
I will post my current code:
data = open(r"C:\Users\dlogan.CLEARDATA\Desktop\ProofHub Upload\test.txt",'rb')
create_headers = {'X-API-KEY': '', 'Content-Type': 'application/json', 'User-Agent': '@cleardata.co.uk'}
r = requests.post('https://cleardata.proofhub.com/files/upload', data=data, headers=create_headers)
Does anyone know how i'd go about including an file?
data = open(r"C:\Users\dlogan.CLEARDATA\Desktop\ProofHub Upload\test.txt",'rb').read()