Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom implementation of API Request Handler #276

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dkarzon
Copy link

@dkarzon dkarzon commented Sep 2, 2024

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