I have a Postman POST request which looks like the following:
The code I'm using to map the above into code using Jersey's WebResource
is the following, but it's not working:
Client authKeyClient = Client.create();
WebResource webResource = authKeyClient.resource("https://ims-na1-stg1.company.com/token/v1");
String input = "{\"grant_type\":\"authorization_code\",\"client_id\":\"orders\",\"client_secret\":\"0af3b233-f1ca-41da-a0fa-61c08d15cadc\",\"code\":\"eyJhbGciOiJSUzI1NiIsIng1dSI6Imltc19uYTEtc\"}";
currentEnv.getImsSecret()).header("code", currentEnv.imsCode).get(String.class);
String response = webResource.post(String.class, input);
I end up getting a 400 Bad Request
. What am I doing wrong ?