Ilan Tochner wrote:Use HTTP_MIMETYPE to set the Content-Type header. Attempts to use HTTP_CUSTOM_HEADER to set it will cause a runtime script error.
Hints that there are limitations with using HTTP_CUSTOM_HEADER with this function. They may extend to your usage as well.
Taking your example, in SL, using HTTP_CUSTOM_HEADER, "Content-Type", "application/json" does yield a runtime script error. Then it does not complete the request. When I run the script in Kitely, it yields a runtime script error, but then delivers a C# Error message as the body of the response (!). I believe this is because of how C# implements their WebRequest class hiding some Headers (Like Content-Type) behind an API. Kitely should simply log a Runtime Script Error and not receive any HTTP response like SL does for those protected headers. Limiting HTTP_CUSTOM_HEADER seems to me to be a workaround for C#'s protection of those Headers.
Understanding this limitation, the header I am having issue with, Authorization, which does not seem to be one of the protected headers, as it is available as an HTTP_CUSTOM_HEADER on SL, which would lead me to believe it should be available as an HTTP_CUSTOM_HEADER in Kitely.