Search code examples
pythoncurlput

putting binary data python sharemy3d


I'm working with ShareMy3D API and came across a problem.

I have a file upload link and need to execute

curl -X PUT -T - "[UPLOAD_URL]" < PATH_TO_LOCAL_FILE  

My specific CURL command:

curl -X PUT -T - https://storage.googleapis.com/sharemy3d-central-us-1-produc‌​tion/alotofstuff < /home/max/Documents/file.obj

After I execute it I always get:

curl: (6) Could not resolve host: <
curl: (3) <url> malformed

Are there other ways to PUT binary files?


Solution

  • All I had to do was execute curl -T file.obj https://example.com.
    With -T (same as --upload-file) curl will use PUT for HTTP