public
Rubygem
Description: Makes http fun! Also, makes consuming restful web services dead easy.
Homepage:
Clone URL: git://github.com/jnunemaker/httparty.git
Click here to lend your support to: httparty and make a donation at www.pledgie.com !
Removed some crappy documentation.
jnunemaker (author)
Tue Nov 11 16:28:04 -0800 2008
commit  99a07b58c2db1223d029cbafb7b58649f71b8b6c
tree    f6c3913becc55c46b03b1ceb24829fec6e4ab05a
parent  b6340ed9d853d602fad27d0118cd61233d3ca563
...
20
21
22
23
 
24
25
26
...
30
31
32
33
 
34
35
36
...
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
...
20
21
22
 
23
24
25
26
...
30
31
32
 
33
34
35
36
...
42
43
44
 
 
 
45
46
47
48
 
 
49
50
51
...
63
64
65
 
 
66
67
68
69
 
70
71
72
73
 
74
75
76
77
 
78
79
80
0
@@ -20,7 +20,7 @@ module HTTParty
0
     base.extend ClassMethods
0
   end
0
   
0
-  module ClassMethods    
0
+  module ClassMethods
0
     def default_options
0
       @@default_options ||= {}
0
     end
0
@@ -30,7 +30,7 @@ module HTTParty
0
     #
0
     #  class Twitter
0
     #    include HTTParty
0
-    #    http_proxy http://myProxy, 1080
0
+    #    http_proxy 'http://myProxy', 1080
0
     # ....
0
     def http_proxy(addr=nil, port = nil)
0
       default_options[:http_proxyaddr] = addr
0
@@ -42,15 +42,10 @@ module HTTParty
0
       default_options[:base_uri] = normalize_base_uri(uri)
0
     end
0
 
0
-    # Warning: This is not thread safe most likely and
0
-    # only works if you use one set of credentials. I
0
-    # leave it because it is convenient on some occasions.
0
     def basic_auth(u, p)
0
       default_options[:basic_auth] = {:username => u, :password => p}
0
     end
0
     
0
-    # Updates the default query string parameters
0
-    # that should be appended to each request.
0
     def default_params(h={})
0
       raise ArgumentError, 'Default params must be a hash' unless h.is_a?(Hash)
0
       default_options[:default_params] ||= {}
0
@@ -68,23 +63,18 @@ module HTTParty
0
       default_options[:format] = f
0
     end
0
     
0
-    
0
-    # TODO: spec out this
0
     def get(path, options={})
0
       perform_request Net::HTTP::Get, path, options
0
     end
0
 
0
-    # TODO: spec out this
0
     def post(path, options={})
0
       perform_request Net::HTTP::Post, path, options
0
     end
0
 
0
-    # TODO: spec out this
0
     def put(path, options={})
0
       perform_request Net::HTTP::Put, path, options
0
     end
0
 
0
-    # TODO: spec out this
0
     def delete(path, options={})
0
       perform_request Net::HTTP::Delete, path, options
0
     end

Comments