Code example for UrlEncodedFormEntity

0
		formparams.add(new BasicNameValuePair("extMethod", "updateUser")); 
		formparams.add(new BasicNameValuePair("extType", "rpc")); 
		formparams.add(new BasicNameValuePair("extUpload", "false")); 
		formparams.add(new BasicNameValuePair("name", "Joe")); 
		formparams.add(new BasicNameValuePair("age", "30")); 
		UrlEncodedFormEntity postEntity = new UrlEncodedFormEntity(formparams, "UTF-8"); 
 
		post.setEntity(postEntity); 
 
		CloseableHttpResponse response = client.execute(post); 
		try { 
			HttpEntity entity = response.getEntity(); 
			assertThat(entity).isNotNull(); 
			String responseString = EntityUtils.toString(entity); 
 
			Map<String, Object> rootAsMap = mapper.readValue(responseString, Map.class); 
			assertThat(rootAsMap).hasSize(5); 
			assertThat(rootAsMap.get("method")).isEqualTo("updateUser"); 
			assertThat(rootAsMap.get("type")).isEqualTo("rpc"); 
			assertThat(rootAsMap.get("action")).isEqualTo("userService"); 
Connect your IDE to all the code out there  Get Codota for Java