class HttpUtils {

	public static String form(String url, Map<String,String> sendData)
			throws IOException {
		CloseableHttpClient httpClient = HttpClients.createDefault();
		try {
			HttpPost httpPost = new HttpPost(url);
			config(httpPost);
			Set<Map.Entry<String,String>> dataSet=sendData.entrySet();
			List<NameValuePair> formParams = new ArrayList<NameValuePair>();
			for(Entry<String,String> entry:dataSet){
				formParams.add(new BasicNameValuePair(entry.getKey(),entry.getValue()));
			}
			UrlEncodedFormEntity uefEntity= new UrlEncodedFormEntity(formParams, Consts.UTF_8.name());
			httpPost.setEntity(uefEntity);
			HttpResponse response = httpClient.execute(httpPost);
			return HttpResToString(response, Consts.UTF_8.name());
		} finally {
			close(httpClient);
		}
		
	}

}