How to send a HTTP OPTIONS request from the command line?

CurlWget

Curl Problem Overview


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 seems to have SSL support but I found no information on how to generate an OPTIONS HTTP request with wget.

Curl Solutions


Solution 1 - Curl

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsorinView Question on Stackoverflow
Solution 1 - CurlDaniel StenbergView Answer on Stackoverflow