public
Description: Ruby HTTP client based on libcurl
Homepage: http://toland.github.com/patron/
Clone URL: git://github.com/toland/patron.git
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 Sat Oct 10 08:19:13 -0700 2009 Ignore the rdoc dir [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 Sat Oct 10 08:19:13 -0700 2009 Include the VERSION.yml file in the gem. [toland]
file VERSION.yml Sun Oct 04 18:13:42 -0700 2009 Version bump to 0.4.4 [toland]
directory ext/ Fri Nov 13 13:06:49 -0800 2009 Specify the connection timeout in seconds to be... [toland]
directory lib/ Wed Nov 25 08:22:02 -0800 2009 support for multiple header fields with same na... [kurowski]
file patron.gemspec Sun Oct 04 18:13:46 -0700 2009 Regenerated gemspec for version 0.4.4 [toland]
directory script/ Tue Nov 24 01:05:16 -0800 2009 support for multiple header fields with same na... [kurowski]
directory spec/ Tue Nov 24 01:05:16 -0800 2009 support for multiple header fields with same na... [kurowski]
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