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.

Parameters:

  • _response (Dynamic)

    The response object received from the client.

  • _http_request (HttpRequest)

    The HttpRequest which was executed.

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.

Parameters:

  • _http_request (HttpRequest)

    The HttpRequest to be executed.

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