如何从命令行发送 HTTP 选项请求?

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

wget似乎支持 SSL,但是我没有找到关于如何使用 wget 生成 OPTIONsHTTP 请求的信息。

149087 次浏览

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)

OPTIONS /path

You can send an OPTIONS request with curl like this:

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

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

OPTIONS *

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