Java Jersey Client Response as JavaScript instead of JSON

Hi Team,

Im providing the Java Jersey Client code where im able to access the ABHM API and executed successfully, but the ClientResoonse im getting is in JavaScript format rather than JSON.

Providing the Java Code below

ClientConfig clientConfig = new DefaultClientConfig();
Client client = Client.create(clientConfig);
webResource = client.resource(baseUri);
webResource.type(MediaType.APPLICATION_JSON);
webResource.accept(MediaType.APPLICATION_JSON);
webResource.acceptLanguage(new Locale(“en”, “us”));

JSONObject jsonObject = new JSONObject();
jsonObject.put(“clientId”, clientId);
jsonObject.put(“clientSecret”, clientSecret);

WebResource webResource = prepareWebResource(clientUrl + webService);
webResource.header(“Authorization”, "Bearer " + accessToken);
response = webResource.post(ClientResponse.class, input.toString());

System.out.println(response.getEntity(String.class));

// CONVERT RESPONSE TO STRING
String output = response.getEntity(String.class);
System.out.println("response from Server … " + response + “\n”);

Hi Team,

Im providing the Java Jersey Client code where im able to access the ABHM API and executed successfully, but the ClientResoonse im getting is in JavaScript format rather than JSON.

Providing the Java Code below

ClientConfig clientConfig = new DefaultClientConfig();
Client client = Client.create(clientConfig);
webResource = client.resource(baseUri);
webResource.type(MediaType.APPLICATION_JSON);
webResource.accept(MediaType.APPLICATION_JSON);
webResource.acceptLanguage(new Locale(“en”, “us”));

JSONObject jsonObject = new JSONObject();
jsonObject.put(“clientId”, clientId);
jsonObject.put(“clientSecret”, clientSecret);

WebResource webResource = prepareWebResource(clientUrl + webService);
webResource.header(“Authorization”, "Bearer " + accessToken);
response = webResource.post(ClientResponse.class, input.toString());

System.out.println(response.getEntity(String.class));

// CONVERT RESPONSE TO STRING
String output = response.getEntity(String.class);
System.out.println("response from Server … " + response + “\n”);

@IntegrationSupport