Authorization not being sent in quotes resulting in invalid json

I’m trying to POST using node-fetch but the Authorization header is being saved and sent without quotes and therefore, resulting in an invalid-json error. I don’t have any idea why is this happening but I discovered that if I add a symbol, for example: ‘Authorization+’, it does get sent within quotes, but of course, the server expects a header named exactly “Authorization” so it’s not a solution. Does anyone know the cause of this and how can I get it to work?

As noted on Discord where you also asked this

The quotes are irrelevant in the construction of a JSON Blob when the key is alphanumeric.

So if you are having a problem it’s something else.

If you are posting and getting a non 200, check the body of the response for reasoning

Follow up from Discord.

https://dev.twitch.tv/docs/api/webhooks-reference#subscribe-tounsubscribe-from-events

It returns a 202 Accepted and no body
And the code presented it trying to JSON parse a non existant body

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.