1.1.27. fejezet, Apache Http

HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost post = new HttpPost(postUrl);
StringEntity postingString = new StringEntity(gson.toJson(pojo1));//pojo to json
post.setEntity(postingString);
post.setHeader("Content-type", "application/json");
HttpResponse  response = httpClient.execute(post);

ObjectMapper mapper = new ObjectMapper();
MyBean bean = mapper.readValue(content, MyBean.class);