如何从命令行发送 HTTP OPTIONS 请求? [英] How to send a HTTP OPTIONS request from the command line?

查看:25
本文介绍了如何从命令行发送 HTTP OPTIONS 请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 cURL,但似乎默认情况下 (Debian) 没有使用 HTTPS 支持编译,我不想自己构建它.

I tried to use cURL but it seems that by default (Debian) is not compiled with HTTPS support and I dont want to build it myself.

wget 似乎支持 SSL,但我没有找到有关如何使用 wget 生成 OPTIONS HTTP 请求的信息.

wget seems to have SSL support but I found no information on how to generate an OPTIONS HTTP request with wget.

推荐答案

Debian 中默认安装的 curl 很久以前就支持 HTTPS.(很久以前有两个单独的包,一个有 SSL,一个没有 SSL,但现在已经不是这样了)

The curl installed by default in Debian supports HTTPS since a great while back. (a long time ago there were two separate packages, one with and one without SSL but that's not the case anymore)

您可以像这样使用 curl 发送 OPTIONS 请求:

You can send an OPTIONS request with curl like this:

curl -i -X OPTIONS http://example.org/path

您也可以使用 -v 代替 -i 来查看更多输出.

You may also use -v instead of -i to see more output.

要发送纯 *(而不是路径,请参阅 RFC7231) 使用 OPTIONS 方法,您需要 curl 7.55.0 或更高版本,然后您可以运行如下命令行:

To send a plain * (instead of the path, see RFC 7231) with the OPTIONS method, you need curl 7.55.0 or later as then you can run a command line like:

curl -i --request-target "*" -X OPTIONS http://example.org

这篇关于如何从命令行发送 HTTP OPTIONS 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆