Class: CoreLibrary::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/apimatic-core-interfaces/client/http_client.rb

Overview

An interface for the methods that an HTTP Client must implement. This class should not be instantiated but should be used as a base class for HTTP Client class.

Instance Method Summary collapse

Instance Method Details

#convert_response(_response, _http_request) ⇒ Object

Converts the HTTP Response from the client to an HttpResponse object.

Raises:

  • (NotImplementedError)


16
17
18
19
# File 'lib/apimatic-core-interfaces/client/http_client.rb', line 16

def convert_response(_response, _http_request)
  raise NotImplementedError, 'This method needs
      to be implemented in a child class.'
end

#execute(_http_request) ⇒ Object

Execute an HttpRequest when the response is expected to be binary.

Raises:

  • (NotImplementedError)


8
9
10
11
# File 'lib/apimatic-core-interfaces/client/http_client.rb', line 8

def execute(_http_request)
  raise NotImplementedError, 'This method needs
      to be implemented in a child class.'
end