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

 

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