最简单的get访问(-X GET可选):
curl www.test.com
使用用户名和密码:
curl -u name:passwd http://www.test.com
查看详细访问过程:
curl -v www.test.com
post访问(因为-d就指定了post,可以省略-X POST):
curl -d "user=kevinchuang&passwd=123456" http://www.test.com
#curl -X POST -d "user=kevinchuang&passwd=123456" http://www.test.com
post指定数据类型:
curl -H "Content-Type:application/json" -d '{"user": "kevinchuang", "passwd":"123456"}' http:www.test.com