I am looking for an equivalent of curl:
curl http://my_url:8080 -H "Content-type: application/csv" -T test.csv
I am especially looking for an alternative to -T filepath
.
I've read the request documentation and all the easy convert method like https://curl.trillworks.com/ or uncurl doesn't convert the parameter -T
.
I found the answer by calling my curl request with verbose.
Use request.put()
with the content of your file in the parameter data
.
response = requests.put(url, headers=headers, data=open(path_file,'r').read())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With