You’re sending the Content-Type header twice, which is not allowed.
It’s really hard to help you debug like this, as we don’t know your original curl commands. Please send full commands along with any output.
Also, make sure to mask your API tokens. I’ve used the one you posted above to log out from your account (so it’s now invalid).
Stay secure,
Peter