public
Description: Ruby HTTP client based on libcurl
Homepage: http://toland.github.com/patron/
Clone URL: git://github.com/toland/patron.git
toland (author)
Sun Aug 30 18:18:07 -0700 2009
commit  946019ac7b93be829a025c35865a7f757d6cd168
tree    0e0bbeb13e026904174a3e88fa406a6ce314ce5b
parent  cf365aa4b417a87fb4128a98872633b950e24a17
patron /
name age message
file .autotest Mon Jan 19 10:43:54 -0800 2009 For some reason autotest wasn't catching change... [toland]
file .gitignore Fri Jul 03 12:04:36 -0700 2009 Added support for YARD. [toland]
file LICENSE Tue Jun 23 09:36:26 -0700 2009 Added license file. [toland]
file README.txt Mon Jul 20 13:21:42 -0700 2009 Revert "Removed the extension from the README f... [toland]
file Rakefile Loading commit data...
file VERSION.yml
directory ext/
directory lib/ Tue Aug 25 11:54:32 -0700 2009 Allow nil timeout to turn off the timeout feature [jameskilton]
file patron.gemspec
directory script/ Thu Aug 13 03:41:38 -0700 2009 simple cookie handling added [jannschu]
directory spec/ Thu Aug 13 08:45:18 -0700 2009 simple cookie handling added Signed-off-by: Ph... [jannschu]
README.txt
= Ruby HTTP Client

== SYNOPSIS

Patron is a Ruby HTTP client library based on libcurl. It does not try to expose
the full "power" (read complexity) of libcurl but instead tries to provide a
sane API while taking advantage of libcurl under the hood.


== USAGE

Usage is very simple. First, you instantiate a Session object. You can set a few
default options on the Session instance that will be used by all subsequent
requests:

    sess = Patron::Session.new
    sess.timeout = 10
    sess.base_url = "http://myserver.com:9900"
    sess.headers['User-Agent'] = 'myapp/1.0'

The Session is used to make HTTP requests.

    resp = sess.get("/foo/bar")

Requests return a Response object:

    if resp.status < 400
      puts resp.body
    end

The GET, HEAD, PUT, POST and DELETE operations are all supported.

    sess.put("/foo/baz", "some data")
    sess.delete("/foo/baz")

You can ship custom headers with a single request:

    sess.post("/foo/stuff", "some data", {"Content-Type" => "text/plain"})

That is pretty much all there is to it.


== REQUIREMENTS

You need a recent version of libcurl in order to install this gem. On MacOS X
the provided libcurl is sufficient. You will have to install the libcurl
development packages on Debian or Ubuntu. Other Linux systems are probably
similar. Windows users are on your own. Good luck with that.


== INSTALL

  sudo gem install patron


Copyright (c) 2008 The Hive