This void for creating the POST.
public void doPostRequest(Object input, String methodName) throws IOException {
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
String JSON_STRING = writer.writeValueAsString(input);
StringEntity requestEntity = new StringEntity(
JSON_STRING,
ContentType.APPLICATION_JSON);
HttpPost postMethod = new HttpPost(methodName);
postMethod.setEntity(requestEntity);
HttpResponse rawResponse = httpClient.execute(postMethod);
}
}
methodName - its String like:
http://myservice:8180/location-service/add
but my postMethod will become after initializing:
http://myservice:8180/location-service/sync_api/add HTTP/1.1
what is HTTP/1.1 ? and how can I delete it??