400 Bad Request on client_credentials request, but only in production!

First off you probably want to do something more like

Which will handle things and test responses more gracefully.

As the the 400, not sure whats going on here. as this endpoint should always return JSON.
I don’t see anything wrong with your code.

This could suggests there is a problem between you and Twitch on production.
Either a firewall or other system.
Or you have having a residual issue from yesterdsays fastly outage. Since fastly will sit in from of the API.
And/or your production provided is having a bad day with routing.