Curb for Win32

ちまちまとソースを修正して、libcurl-7.15.1-msvc-win32でビルドできた。

で、使ってみる。

require 'curb'
c = Curl::Easy.new("http://www.google.com")
c.perform
p c.body_str

c.follow_location = true
c.perform
p c.body_str

open-uriよりもシンプルな感じ。
「c.follow_location = true」でLocationヘッダをサポートしてくれるのは、便利かも。

curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

使い道はいろいろありそう。