Method: LabClient::HTTP#request
- Defined in:
- lib/labclient/http.rb
#request(method, path, body = {}, dump_json = true) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/labclient/http.rb', line 20 def request(method, path, body = {}, dump_json = true) = { method: method, headers: headers(dump_json) } if body && !body.empty? case method when :get [:params] = body else # File Upload shouldn't be jsonfied [:body] = dump_json ? Oj.dump(body, mode: :compat) : body end end .merge!(disable_ssl) unless settings[:ssl_verify] Typhoeus::Request.new(url(path), ).run end |