Skip to content
Newer
Older
100644 51 lines (38 sloc) 2.09 KB
0e4c84d @pezra initial commit of blog posts
authored Feb 25, 2009
1 [Resourceful][] has its [initial (0.2) release][resourceful-0.2]
2 [today][paul-resourceful-announce].
3
4 Resourceful is a sophisticated HTTP client library for Ruby. It will
5 (when it is complete, at least) provide an simple API for fully
6 utilizing the amazing goodness that is HTTP.
7
8 It is already tasty, though. The 0.2 release provides
9
10 * fully compliant HTTP caching
11 * a framework for implementing cache managers (memory based cache manager provided)
12 * fully compliant transparent redirection handling (with hooks for overriding the default behavior)
13 * plugable HTTP authentication handling (Basic provided)
14
15 ### Introduction
16
17 The API is strongly influenced by our successful experiences with
18 REST. Each URI is represented by a `Resource` object. The `Resource`
19 objects act as a proxy for the conceptual resource. `Resources`
20 expose the basic set of HTTP verbs: get, put, post, delete. For
21 example to get a representation of some resource you do this
22
23 require 'resourceful'
24 http = Resourceful::HttpAccessor.new
25 resp = http.resource('http://rubyforge.org').get
26 puts resp.body
27
28
29 If you want to post a form you do this
30
31 require 'resourceful'
32 http = Resourceful::HttpAccessor.new
33 resp = http.resource('http://rubyforge.org').put("name=Peter&hobbies=programming,diy", :cotent_type => "application/x-www-form-urlencoded")
34 puts resp.code
35
36 All non-2xx responses are either handled transparently (e.g. by
37 following redirects) or the method will raise a
38 `UnsuccessfulHttpRequestError`.
39
40 ### Conclusion
41
42 If you need a decent HTTP library in Ruby come on over and check it
43 out. If you see something you want, or want fixed, feel free to
44 branch the [git repo][git-repo] and do it. [Paul][paul] and I would
45 love some more contributors and will welcome you with open arms.
46
47 [paul]: http://www.theamazingrando.com/blog/
48 [paul-resourceful-announce]: http://www.theamazingrando.com/blog/index.php/2008/06/30/announcing-resourceful/
49 [resourceful]: http://resourceful.rubyforge.org/
50 [resourceful-0.2]: http://github.com/paul/resourceful/commits/rel_0.2
51 [git-repo]: http://github.com/paul/resourceful/tree/master
Something went wrong with that request. Please try again.