curl 常用指令整理

1. 抓網頁內容,預設 HTTP GET Method

curl http://xxx

 

2. 使用 HTTP POST Method

curl -d "id=xxx&book=ooo" http://xxx

 

3. 抓網頁,輸出檔案

curl -o FileName.html http://xxx

 

4. 下載檔案(注意:是大寫的英文O)

curl -O http://xxx/FileName.zip

 

5. 下載 FTP 檔案

curl -u UserName:Passwd ftp://ip:port/path/file

curl ftp://UserName:Passwd@ip:port/path/file

 

6. 上傳檔案 HTTP PUT Method

curl -T LocalFile -u UserName:Passwd ftp://ip:port/path/file

curl -T LocalFile http://xxx.cgi

 

7. 看 HTTP header

curl -head http://xxx

 

參考網址:

1. 官方 http://curl.haxx.se

2. http://evelynnote.blogspot.tw/2011/03/curl.html

3. http://blog.csdn.net/ithomer/article/details/7626929

posted @ 2014-03-22 22:42  a-jay  阅读(204)  评论(0编辑  收藏  举报