0

I am trying to make a POST with javax. Keep getting the 400 bad request response code. It suggests that there is something wrong with the json being sent(?) I have checked the json a hundred times, it looks pretty good to me. What am I missing?

enter code here

Client client = ClientBuilder.newClient();
Entity payload = Entity.json("{  'offset': 0,  'limit': 15,  'query': 'ad',  'search_type': 'global'}");
Response response = client.target("https:******/contacts/search")
                .request(MediaType.APPLICATION_JSON_TYPE)
                .header("Accept", "application/json")
                .header("authToken", ACCESS_TOKEN)
                .post(payload);
irrelevantUser
  • 1,172
  • 18
  • 35

0 Answers0