From @divad4686 on Monday, February 13, 2017 7:31:15 AM
I'm building a Webhook provider library, and one of the requirements I have is to change the default Webhook request body. I can do this by overriding the CreateWebHookRequestBody in the WebHookSender class.
The problem is that my request body have to be wrapper in an array ( it is a requirement for Rest Hooks in Zapier) but the functions CreateWebHookRequest, CreateWebHookRequestBody and SignWebHookRequest all work with JObject class, making it impossible to wrap the body in an array.
I fixed this by overriding the 3 functions in my own class, but most of the work was copy-pasting the default implementation, replacing JObject for JContainer and using JArray.FromObject in CreateWebHookRequestBody.
I think I could do a pull request here in the project with this commit so people will have it easy later to use JArray or JObject in their own implementations. This should not have any side effect, since in the end, outside CreateWebHookRequestBody, all it is done with this object is a. .ToString()
The only problem I could see is that it would not compile the project for people that already override CreateWebHookRequestBody
Copied from original issue: aspnet/WebHooks#115