各種プロトコル対応のクライアントソフト
cURL 公式:curl
Unix、Linux、Windows他各OS対応版あり。
http://、https://、ftp://、gopher://、dict://、telnet://、、、様々なプロトコルに対応してダウンロード・アップロードが可能なクライアントソフト。プロキシに対応し、認証必要なサーバにも対応。
Unix、Linux系ではwgetの方が定番で、GNUにWindows版もあるが、このcURLも負けてはいない。
マニュアルから抜粋して簡単に使い方例和訳
- ページ取得
- curl http://www.netscape.com/
curl ftp://ftp.myserver.jp/README
curl http://www.netscape.com/ ftp://ftp.myserver.jp/README(1度に2つ同時)- ページを取得して保存
- curl -o savefile.html http://www.netscape.com/
curl -O http://www.netscape.com/index.html(サーバ上のファイル名と同じ名前で保存)
curl -O www.haxx.se/index.html -O curl.haxx.se/download.html(1度に2つ同時)- バイト指定ダウンロード
- 先頭から100byteだけ取得 curl -r 0-99 http://www.get.this/
最後から500byteだけ取得 curl -r -500 http://www.get.this/- 認証
- curl ftp://name:passwd@machine.domain:port/full/path/to/file
または curl -u name:passwd ftp://machine.domain:port/full/path/to/file- プロキシ
- curl -x my-proxy:8888 ftp://ftp.myserver.jp/README
認証は curl -u user:passwd -x my-proxy:888 http://www.get.this/- アップロード
- 標準入力をアップロード curl -T - ftp://ftp.upload.com/myfile
認証は curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile- POST送信
- curl -d "name=Rafael%20Sagula&phone=3320780" http://www.where.com/guest.cgi
- REFERRER指定
- curl -e www.coolsite.com http://www.showme.com/
- USER AGENT指定
- curl -A 'Mozilla/3.0 (Win95; I)' http://www.nationsbank.com/
他様々なオプションがある。ヘッダやクッキーについても弄れたり。USER AGENTが偽装できるってことは携帯専用ページも取得できるということです。素晴らしい。
コマンドラインでチョコチョコっと他のソフトとの連携が出来て便利。
香り屋 — KaoriYaの「Chalice for Vim」でも使用していました。