Class: Tire::HTTP::Client::Curb
- Inherits:
-
Object
- Object
- Tire::HTTP::Client::Curb
- Defined in:
- lib/tire/http/clients/curb.rb
Class Method Summary collapse
- .delete(url) ⇒ Object
- .get(url, data = nil) ⇒ Object
- .head(url) ⇒ Object
- .post(url, data) ⇒ Object
- .put(url, data) ⇒ Object
Class Method Details
.delete(url) ⇒ Object
43 44 45 46 47 |
# File 'lib/tire/http/clients/curb.rb', line 43 def self.delete(url) @client.url = url @client.http_delete Response.new @client.body_str, @client.response_code end |
.get(url, data = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tire/http/clients/curb.rb', line 15 def self.get(url, data=nil) @client.url = url # FIXME: Curb cannot post bodies with GET requests? # Roy Fielding seems to approve: # <http://tech.groups.yahoo.com/group/rest-discuss/message/9962> if data @client.post_body = data @client.http_post else @client.http_get end Response.new @client.body_str, @client.response_code end |
.head(url) ⇒ Object
49 50 51 52 53 |
# File 'lib/tire/http/clients/curb.rb', line 49 def self.head(url) @client.url = url @client.http_head Response.new @client.body_str, @client.response_code end |