Class: Animoto::HTTPEngines::NetHTTPAdapter
- Defined in:
- lib/animoto/http_engines/net_http_adapter.rb
Constant Summary collapse
- HTTP_METHOD_MAP =
A map of HTTP verb symbols to the Net::HTTP classes that handle them.
{ :head => Net::HTTP::Head, :get => Net::HTTP::Get, :post => Net::HTTP::Post, :put => Net::HTTP::Put, :delete => Net::HTTP::Delete }
Instance Method Summary collapse
Instance Method Details
#request(method, url, body = nil, headers = {}, options = {}) ⇒ String
18 19 20 21 22 23 24 |
# File 'lib/animoto/http_engines/net_http_adapter.rb', line 18 def request method, url, body = nil, headers = {}, = {} uri = URI.parse(url) http = build_http uri, req = build_request method, uri, body, headers, response = http.request req [response.code.to_i, response.body] end |