curl常用功能

最简单的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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章