From 3ab9d777e9d65f55fdcd041ebd5afefdd5b4e3d4 Mon Sep 17 00:00:00 2001 From: Muhammad Sufyan Date: Fri, 30 Aug 2024 17:03:14 +0500 Subject: [PATCH] refactor(http-callback): make Http Callback class override-able (#79) This commit makes `OnBeforeHttpRequestEventHandler` and `OnAfterHttpResponseEventHandler` methods virtual. This allows SDKs to override these methods and invoke user-overridden callbacks methods provided in the SDK class. Closes #78 --- APIMatic.Core/Types/HttpCallBack.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APIMatic.Core/Types/HttpCallBack.cs b/APIMatic.Core/Types/HttpCallBack.cs index f0a412a..99dbce5 100644 --- a/APIMatic.Core/Types/HttpCallBack.cs +++ b/APIMatic.Core/Types/HttpCallBack.cs @@ -24,7 +24,7 @@ public class HttpCallBack /// BeforeHttpRequestEventHandler. /// /// Http Request. - public void OnBeforeHttpRequestEventHandler(CoreRequest request) + public virtual void OnBeforeHttpRequestEventHandler(CoreRequest request) { Request = request; } @@ -34,7 +34,7 @@ public void OnBeforeHttpRequestEventHandler(CoreRequest request) /// /// Http Client. /// Http Response. - public void OnAfterHttpResponseEventHandler(CoreResponse response) + public virtual void OnAfterHttpResponseEventHandler(CoreResponse response) { Response = response; }