Adam B Adam B - 3 months ago 19
HTTP Question

Is it possible to send "OPTIONS *" with cURL?

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


When a client wishes to request OPTIONS for the server as a whole, as opposed to a specific named resource of that server, the client must send only "*" (%x2A) as the request-target.


To test how my site reacts I want to send the following request to the server.

OPTIONS * HTTP/1.1


I know I can use telnet, write my own client, etc.
But I want to know if it's possible to do it with cURL?

Edit
This can NOT be done with
curl -X OPTIONS http://example.org
, as suggested in a similar, but not identical, question That command will send
OPTIONS http://example.org/ HTTP/1.1
. I want to know if it's possible to send the asterisk with cURL.

Answer

(speaking as the main curl developer)

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