curl命令

定位后端接口是否ok,经常使用到curl

-b/cookie  <name=string/file> cookie字符串或文件读取位置

curl http://localhost --cookie "BDUSS=123"
curl http://localhost --cookie cookie.txt
 -c/--cookie-jar <file> 操作结束后把cookie写入到这个文件中
curl http://localhost -c cookie.txt
 -H/--header <line>自定义头信息传递给服务器
curl http://locaohost -H 'HOST:www.baidu.com'

 -I/--head  只显示文档信息,只显示返回的header信息

curl http://locaohost -H 'HOST:www.baidu.com' -I

-v : 显示请求和返回的header信息

-d:上传post数据

curl 'http://www.baidu.com' -d 'name=jimmy'

http://www.codesky.net/article/201010/170043.html

原文地址:https://www.cnblogs.com/bai-jimmy/p/4463532.html