开发者

How to use http-delete from the shell

开发者 https://www.devze.com 2022-12-31 07:09 出处:网络
Is it possib开发者_开发知识库le to send a HTTP DELETE request from the shell and if so, how?curl -X delete URL

Is it possib开发者_开发知识库le to send a HTTP DELETE request from the shell and if so, how?


curl -X delete URL

see (google cache, server seems slow) reference.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号