views:

24

answers:

2

Is it possible to send a HTTP DELETE request from the shell and if so, how?

A: 

There are probably a lot of tools to do this, but the easiest, if you don't want to make sure those tools are available, might be to manually create your DELETE-request and send it to the server via telnet. I think the syntax is pretty much like this, although I've never used the delete command manually myself, only get and post.

DELETE /my/path/to/file HTTP/1.1
Host: www.example.com
Connection: close

There should be an extra newline (blank line) after the request to terminate it, but markdown won't allow me to do that. Store that in a file (or paste it in the console, if you don't want to use a script), then simply do

telnet www.example.com 80 < myRequest.txt

Of course, you can use a here-document as well.

roe
+4  A: 
curl -X delete URL

see (google cache, server seems slow) reference.

catchmeifyoutry