使用以下命令的输出,
% 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
在命令中指定?
= 获取/问题
= 获取 /87whjjgaas.asd
= 获取/问题
为了
答案是
:)
我需要查看服务器在某些“错误”路径下的行为。要阻止 curl 规范化路径,可以
--path-as-is
选择。