What is the equivalent of:
curl --data-binary @myjarfile.jar localhost:10000/acceptjar
In python with the requests api?
The .jar file is a binary file that gets "posted" to a server that expects to receive the jar file.
This doesn't handle errors, but should post a file to a server as an octet stream:
import requests
res = requests.post(url='http://example.com/post',
data=open('example.file', 'rb'),
headers={'Content-Type': 'application/octet-stream'})
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