I have a python snippet for a posting a file onto an URL:
import requests
url = 'http://www.test.com/route'
files = {'pdf': open('/path/to/file/abc.pdf', 'rb'), 'variable_1': '1', 'variable_2': '2'}
r = requests.post(url, files=files)
print(r.status_code)
It works! And I am looking for the cURL equivalent for the same!
I have tried this:
curl -X POST http://www.test.com/route -H 'content-type: application/json' -F pdf=@/path/to/file/abc.pdf -F variable_1=1 -F variable_2=2
What would be the correct curl? Thanks!
curl?