How can I do a HTTP PUT with Wget?

wget --method=PUT --body-data=<STRING>

This is a bit late, but at some point after the original post, they added a "--method" option. I'm not sure when it was added, but see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684189#24 for details.


Wget can't do PUT. Use cURL instead, with -T.


Since this is REST interface, I think you'd want to use curl with -X PUT, like this:

curl -i -X PUT http://www.example.tld/rest/updateEntity/1234?active=false

Or if you need to "post" data from a file, like an XML:

curl -i -X PUT -H "Content-Type: application/xml; charset=utf-8" -d @"/tmp/some-file.xml" http://www.example.tld/rest/updateEntity