Naishu Babu
Naishu Babu

Reputation: 61

Curl coudn't resolve proxy 'PUT'

I'm trying to add a link to a already existing bucket in RIAK which was created by me before using POST , and now im getting the following error.

curl -x PUT http://localhost:8091/riak/games/fallout4 -H 'Content-type: image/jpeg" -H "Link:</riak/photos/vaultboy.jpeg>;riaktag=\"photo\"" --data-binary @vaultboy.jpeg

curl:(5)Couldn't resolve proxy 'PUT'

Upvotes: 0

Views: 2190

Answers (1)

Gilles Qu&#233;not
Gilles Qu&#233;not

Reputation: 185760

It's a -X uppercase, not -x lowercase, so :

curl -X PUT http://localhost:8091/riak/games/fallout4 -H 'Content-type: image/jpeg" -H "Link:</riak/photos/vaultboy.jpeg>;riaktag=\"photo\"" --data-binary @vaultboy.jpeg

or as @Daniel Stenberg stated in comments :

curl http://localhost:8091/riak/games/fallout4 -H 'Content-type: image/jpeg" -H 'Link:</riak/photos/vaultboy.jpeg>;riaktag="photo"' -T vaultboy.jpeg

From

man curl | less +/--upload-file

:

-T, --upload-file

This transfers the specified local file to the remote URL. If there is no file part in the specified URL, curl will append the local file name. NOTE that you must use a trailing / on the last directory to really prove to Curl that there is no file name or curl will think that your last directory name is the remote file name to use. That will most likely cause the upload operation to fail. If this is used on an HTTP(S) server, the PUT command will be used.

Upvotes: 3

Related Questions