-X switch to :GET/POST or other HTTP methods
-v: show everything
-s: silent mode progress bar.
-
curl -v -X POST -d "fizz=buzz" http://requestb.in/tmy77qtm
-c: receive and store cookies from one request
-b: send the cookie jar
-
curl -c cookiejar.txt http://requestb.in/example
-
curl -b cookiejar.txt http://requestb.in/example
-H: send full header
-d: -d @data.txt or -d "name=value" or --data "name=value": send data
-
curl -H "Accept: application/json" http://localhost/hello.php #will return json
-
curl -H "Accept: text/html;q=0.5,application/json" #return json as well
-
curl -v -X POST -H "Content-Type: application/json" '{"link": "","name": "notebook"}' #same as upper
-
curl -v -H "Content-Type:text/xml" / #will return xml
-L: (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location:
header and a 3XX response code), this option will make curl redo the request on the new place,就是能处理redirect,从github下载可以用curl -OkvL
-O: --remote-name: 远程文件名
-k: --insecure: allows curl to perform "insecure" SSL connections and transfers
-I, --head: (HTTP/FTP/FILE) Fetch the HTTP-header only
阅读(1361) | 评论(0) | 转发(0) |