Can I send "OPTIONS *" using cURL?

From RFC7230 Hypertext Transfer Protocol (HTTP / 1.1): Message Syntax and Routing

When the client wants to request OPTIONS for the server as a whole, unlike the specific named resource of this server, the client should send only "*" (% x2A) as the request target.

To check how my site responds, I want to send the following request to the server.

OPTIONS * HTTP/1.1

I know that I can use telnet, write my own client, etc. But I want to know if this can be done with cURL?

Edit This cannot be done using curl -X OPTIONS http://example.org, as suggested in a similar but not identical question. This command will send OPTIONS http://example.org/ HTTP/1.1. I want to know if it is possible to send an asterisk cURL.

+4
source share
2 answers

(acting as the main developer of the twists)

I honestly don’t think it’s possible (that is, using -X OPTIONS, etc. will send a slash, not an asterisk), although I would, of course, be very open to make this possible in a future version in case someone wants to join in and help us eliminate this supervision.

+5
source

You can send custom requests using cURL with the -x option, https://curl.haxx.se/docs/manpage.html#-x

So this command will look like this:

curl -X OPTIONS http://example.com
-1
source

All Articles