使用cURL向Web服务器发送Web请求时如何指定GETpath?

使用下面的命令输出,

% curl -v stackoverflow.com/questions * About to connect() to stackoverflow.com port 80 (#0) * Trying 198.252.206.16... * Connected to stackoverflow.com (198.252.206.16) port 80 (#0) > GET /questions HTTP/1.1 > User-Agent: curl/7.29.0 > Host: stackoverflow.com > Accept: */* 

我可以做curl -X GET -H "User-Agent: curl/7.29.0" -H "Host: stackoverflow.com" -H "Accept: */*" 198.252.206.16复制请求,但我该如何指定GET /questions在我的命令?

 stackoverflow.com/questions 

= GET /问题

 stackoverflow.com/87whjjgaas.asd 

= GET /87whjjgaas.asd

 23.123.123.123/questions 

= GET /问题

对于

curl -X GET -H“User-Agent:curl / 7.29.0”-H“Host:stackoverflow.com”-H“Accept: / ”198.252.206.16

答案是

curl -X GET -H“User-Agent:curl / 7.29.0”-H“Host:stackoverflow.com”-H“Accept: / ”198.252.206.16/questions

🙂