Skip to content

Commit

Permalink
refactor(http-callback): make Http Callback class override-able (#79)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sufyankhanrao authored Aug 30, 2024
1 parent 846807f commit 3ab9d77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions APIMatic.Core/Types/HttpCallBack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class HttpCallBack
/// BeforeHttpRequestEventHandler.
/// </summary>
/// <param name="request">Http Request.</param>
public void OnBeforeHttpRequestEventHandler(CoreRequest request)
public virtual void OnBeforeHttpRequestEventHandler(CoreRequest request)
{
Request = request;
}
Expand All @@ -34,7 +34,7 @@ public void OnBeforeHttpRequestEventHandler(CoreRequest request)
/// </summary>
/// <param name="source">Http Client.</param>
/// <param name="response">Http Response.</param>
public void OnAfterHttpResponseEventHandler(CoreResponse response)
public virtual void OnAfterHttpResponseEventHandler(CoreResponse response)
{
Response = response;
}
Expand Down

0 comments on commit 3ab9d77

Please sign in to comment.