Skip to content

Allow custom implementation of API Request Handler#276

Open
dkarzon wants to merge 4 commits into
myob-oss:masterfrom
dkarzon:api-handler-interface
Open

Allow custom implementation of API Request Handler#276
dkarzon wants to merge 4 commits into
myob-oss:masterfrom
dkarzon:api-handler-interface

Conversation

@dkarzon

@dkarzon dkarzon commented Sep 2, 2024

Copy link
Copy Markdown

Added in IApiRequestHandler so that custom logic can be applied to the underlying API request handling by integrators.
To do this I also added the IApiRequestHandlerFactory interface which will create an instance of IApiRequestHandler with a default implementation ApiRequestHandlerFactory that will return the existing ApiRequestHandler with the existing parameters.
This allows the underlying HTTP calls to be overridden by the integrator for extra custom functionality (with the idea that these implementations will be based on the existing implementations).

Example usages of this interface:

  • Adding custom logging to outgoing HTTP requests
  • Implementing retry logic within the HTTP handler for responses such as 429 too many requests or 504 gateway timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant