Module: Tom::Http
- Defined in:
- lib/http.rb
Class Method Summary collapse
-
.make_request(method, url, options = {}) ⇒ Object
Makes a http request of the given method to the given url.
Class Method Details
.make_request(method, url, options = {}) ⇒ Object
Makes a http request of the given method to the given url. Passes the options on to EM::HttpRequest.put (or whatever method has to be called) and does some error handling and works around some EM:HttpRequest oddities (see handle_errors).
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/http.rb', line 14 def self.make_request(method, url, = {}) Tom::Log.logger.info " curl -X#{method.upcase} -d '#{[:body]}' #{url}" conn = EM::HttpRequest.new(url, ) result = conn.send(method, ) # Disabling this for a while # handle_errors(method, url, result) result end |