Bug in REST API Webhooks
There is a bug inside the code of the api that adds in the header to a webhook in that if the header is to specify a content type you get the error The 'Content-Type' header must be modified using the appropriate property or method.
The fix is to change the one line inside the loop that adds the headers from
to
The fix is to change the one line inside the loop that adds the headers from
- Code: Select all
webRequest.Headers[subscriptionRequestHeader.Name] = subscriptionRequestHeader.Value;
to
- Code: Select all
if(subscriptionRequestHeader.Name.ToUpper() == "CONTENT-TYPE")
{
webRequest.ContentType = subscriptionRequestHeader.Value;
}
else
{
webRequest.Headers[subscriptionRequestHeader.Name] = subscriptionRequestHeader.Value;
}