0

I need to send the JSON response from GenericJsonWebHookReceiver provided by Nuget package in ASP.NET. I am trying to send the JSON value in the return call like this - "return Task.FromResult(sampleJson);"  , where sampleJson is a valid JSON in string format. But while testing, I am still getting empty response.

How can we send the JSON response with GenericJsonWebHookReceiver? Also how to set the proper header type in the response to define it as JSON type response?

Thanks, /vikas

Vikas
  • 41
  • 5
  • Can you post your action method were you are setting the response from GenericJsonWebHookReceiver? Most likely this is a duplicate of http://stackoverflow.com/questions/9777731/mvc-how-to-return-a-string-as-json – Cat_Clan Apr 24 '17 at 22:45
  • ` public override Task ExecuteAsync(string generator, WebHookHandlerContext context) { // Get data from WebHook CustomNotifications data = context.GetDataOrDefault(); foreach (IDictionary notification in data.Notifications) { // Process data } // Get data from each notification in this WebHook JObject JO = new JObject(); return Task.FromResult(true); }` – Vikas May 01 '17 at 22:14

0 Answers0