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
44 45 46 47 48 |
# File 'lib/tire/http/clients/curb.rb', line 44 def self.delete(url) @client.url = url @client.http_delete Response.new @client.body_str, @client.response_code end |
.get(url, data = nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/tire/http/clients/curb.rb', line 16 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
50 51 52 53 54 |
# File 'lib/tire/http/clients/curb.rb', line 50 def self.head(url) @client.url = url @client.http_head Response.new @client.body_str, @client.response_code end |