Server to server oauth "unsupported grant type"

I get the same error when posting to /oauth/token from my python script. According the links below, setting the content type to “application/x-www-form-urlencoded” in the header might solve your problem. Wasn’t that simple for me, unfortunately, I’m still stuck.