lib/async/http/client.rb in async-http-0.3.1 vs lib/async/http/client.rb in async-http-0.4.0
- old
+ new
@@ -30,13 +30,27 @@
@protocol_class = protocol_class
end
GET = 'GET'.freeze
+ HEAD = 'HEAD'.freeze
+ POST = 'POST'.freeze
- def get(path, headers = {})
+ def get(path, *args)
connect do |protocol|
- protocol.send_request(GET, path, headers)
+ protocol.send_request(GET, path, *args)
+ end
+ end
+
+ def head(path, *args)
+ connect do |protocol|
+ protocol.send_request(HEAD, path, *args)
+ end
+ end
+
+ def post(path, *args)
+ connect do |protocol|
+ protocol.send_request(POST, path, *args)
end
end
private