I have implemented webhook for revenuecat in .net core C#. But for some reason I am getting 400 badrequest with empty response. I am mostly sure that I am not getting the json response in webook through revenuecat for any of the event occurring.
I have also added endpoint on revenue cat webhook with authentication. I have tried several time and as I have not way to test this on local machine. I need help from revenue cat team to provide some reference doc with sample implementation just to get proper json response. Below is the code snippet that I am using to get json response from the webhook endpoint added in revenuecat.
var webHookSecret = _configuration[Constants.RevenueCatWebHookSecret];
var headerAuthorization = HttpContext.Request.Headers["Authorization"].ToString();
#region Check authorization
if (webHookSecret == headerAuthorization)
json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
_logger.Information($"Un-Authorized token access in revenuecat webhook. Returning BadRequest response.");
throw new APIException(HttpStatusCode.Unauthorized, new APIError(_configuration, "InternalServerError"));