关于linux curl 地址参数的问题

时间:2021-07-28 12:39:56

例如 
url 为 http://mywebsite.com/index.PHP?a=1&b=2&c=3
web形式下访问url地址,使用$_GET是可以获取到所有的参数
然而在Linux下
curl http://mywebsite.com/index.php?a=1&b=2&c=3
$_GET只能获取到参数a
由于url中有&,其他参数获取不到,在linux系统中& 会使进程系统后台运行
必须对&进行下转义才能$_GET获取到所有参数
curl http://mywebsite.com/index.php?a=1\&b=2\&c=3

curl执行时间验证:可以通过以下方法

curl -o /dev/null -s -w "time_total: %{time_total}\n" "http://mywebsite.com/index.PHP?a=1&b=2&c=3"