Hi all
I need to do this HTTP request:
curl -X POST -d "client_id=CLIENT_ID" -d "client_secret=CLIENT_SECRET" --data-urlencode "username=MY_USERNAME" --data-urlencode "password=MY_PASSWORD" -d 'grant_type=password' 'https://auth.contabo.com/auth/realms/contabo/protocol/openid-connect/token'
This is the function that is before the HTTP REQUEST (setup with POST):
msg.headers = {};
msg.headers['accept'] = 'application/json';
msg.headers['Content-Type'] = 'application/json';
msg.payload = {};
msg.payload.grant_type = 'password';
msg.payload.client_id = 'CLIENT_ID';
msg.payload.client_secret = 'CLIENT_SECRET';
msg.payload.username = encodeURIComponent('MY_USERNAME');
msg.payload.password = encodeURIComponent('MY_PASSWORD');
return msg;
But I keep getting the error:
{"error":"RESTEASY003065: Cannot consume content type"}
What am I doing wrong?
Thanks!