Hey! Really hope this hasn’t been answered before (if so, my apologies, I was unable to find someone with a similar issue), but I’m trying to wrap my head around webhooks and specifically POST requests sent from Twitch to my local server.
Subscribing to any topic works perfectly fine, but once an event happens, the POST request from Twitch initially just seems to contain a number of headers, but no body.
I spent several hours experimenting and trying to pass a 100 status code (either with or without the {‘Expect’:‘100-continue’} header) as a response to the POST, hoping Twitch to again respond with the body containing the infotmation on the event, but apparently my response is not being processed. I can pass a 200 code at any time, which makes Twitch stop trying to reach out to my server (indicating that generally, my responses do reach Twitch), but that doesn’t solve the issue of the missing body.
Whenever I don’t immediately return a 200 code, however, Twitch retries and this time, on consecutive POST requests from Twitch, the event information is contained in the shape of a buffer (which is fine, would prefer JSON, but I can use that).
Now, it feels to me, I’m missing something very simple. I could tell my server to always wait for the first retry, parse the information contained in the buffer and then return a 200 status code to conclude our exchange, but that can’t be the most elegant solution. What am I missing?
I really appreciate the help! Best