Class: CoreLibrary::HttpCallback

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

Overview

HttpCallBack allows defining callables for pre and post API calls. This class should not be instantiated but should be used as a base class for capturing the request and response of an API call.

Instance Method Summary collapse

Instance Method Details

#on_after_response(_http_response) ⇒ Object

A controller will call this method after making an HTTP Request.

Parameters:

  • _http_response (HttpResponse)

    The HttpResponse of the API call.

Raises:

  • (NotImplementedError)


15
16
17
18
# File 'lib/apimatic-core-interfaces/types/http_callback.rb', line 15

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

#on_before_request(_http_request) ⇒ Object

A controller will call this method before making an HTTP Request.

Parameters:

  • _http_request (HttpRequest)

    The HttpRequest object which the HttpClient will execute.

Raises:

  • (NotImplementedError)


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

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