1.1.27. fejezet, HttpClient

	public static JsonObject sendPostRequestWithHttpClient(String urlString, String accessToken, String body) throws Exception {
		HttpClient client = HttpClientBuilder.create().build();
		HttpPost post = new HttpPost(urlString);
		post.setHeader("Content-Type", "application/json");
		post.setHeader("Authorization", "Bearer " + accessToken);
		post.setHeader("cache-control", "no-cache");
		post.setHeader("x-li-format", "json");
		post.setHeader("X-Restli-Protocol-Version", "2.0.0");
		StringEntity requestEntity = new StringEntity(body, "UTF-8");
		post.setEntity(requestEntity);
		HttpResponse response = client.execute(post);
		HttpEntity entity = response.getEntity();
		String responseString = EntityUtils.toString(entity, "UTF-8");
		JsonReader jsonReader = Json.createReader(new StringReader(responseString.toString()));
		JsonObject jsonObject = jsonReader.readObject();
 
		return jsonObject;
	}