itszero / patron forked from toland/patron

Ruby HTTP client based on libcurl

This URL has Read+Write access

itsZero (Chien-An "Zero" Cho) (author)
Mon Aug 24 11:01:10 -0700 2009
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 Aug 24 11:01:10 -0700 2009 Add ssl_verifypeer option [itsZero (Chien-An "Zero" Cho)]
file Rakefile Thu Aug 13 08:56:28 -0700 2009 Fixed the Rubyforge tasks. [toland]
file VERSION.yml Thu Aug 13 08:56:01 -0700 2009 Version bump to 0.4.2 [toland]
directory ext/ Loading commit data...
directory lib/ Mon Aug 24 11:01:10 -0700 2009 Add ssl_verifypeer option [itsZero (Chien-An "Zero" Cho)]
file patron.gemspec Mon Aug 24 11:01:10 -0700 2009 Add ssl_verifypeer option [itsZero (Chien-An "Zero" Cho)]
directory script/ Thu Aug 13 08:45:18 -0700 2009 simple cookie handling added Signed-off-by: Ph... [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

== Fork

This fork version provides you with Patron::Session.new.ssl_verifypeer options. If you're
accessing a remote that using self-signed or invalid certificates. You can set it to
false to force libcurl accept the SSL connection.

== 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