I'm trying to do a request using a small Java program but I'm getting a 400 - Bad Request as response:
URI uri = new URIBuilder().setScheme("https")
.setHost("somehost.com")
.setPath("/API/v1/export").build();
HttpPost post = new HttpPost(uri);
post.setHeader("X-API-ID", "myId");
post.setHeader("Accept", "application/json");
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("format", "csv"));
params.add(new BasicNameValuePair("userId", "userId"));
post.setEntity(new UrlEncodedFormEntity(params));
JsonNode responseJson = sendResponseEngineRequest(post);
This responseJson returns the following value:
{"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Invalid Content-Type. expected=application/json found=application/x-www-form-urlencoded","errorCode":"RP_0.1"}}}
Thanks in advance.