Class: Animoto::HTTPEngines::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/animoto/http_engines/base.rb

Overview

This class is abstract.

Override #request to subclass.

Instance Method Summary collapse

Instance Method Details

#request(method, url, body = nil, headers = {}, options = {}) ⇒ Array[Integer,String]

This method is abstract.

Make a request.

Parameters:

  • method (Symbol)

    the HTTP method to use, should be lower-case (that is, :get instead of :GET)

  • url (String)

    the URL to request

  • body (String, nil) (defaults to: nil)

    the request body

  • headers (Hash{String=>String}) (defaults to: {})

    request headers to send; names will be sent as-is (for example, use keys like “Content-Type” and not :content_type)

  • options (Hash{Symbol=>Object}) (defaults to: {})

Options Hash (options):

  • :timeout (Integer)

    set a timeout

  • :username (String)

    the authentication username

  • :password (String)

    the authentication password

Returns:

  • (Array[Integer,String])

    array of status code and response body

Raises:



31
32
33
# File 'lib/animoto/http_engines/base.rb', line 31

def request method, url, body = nil, headers = {}, options = {}
  raise AbstractMethodError
end