Code example for HttpPost

Methods: setParams

0
	} 
	 
	public boolean upvoteMessage(BigInteger id) throws IOException
	{ 
		final String url = "http://" + entrypointHostname + ":" + entrypointPort + "/controller?command=upvote";
		HttpPost request = new HttpPost(url);
		BasicHttpParams params = new BasicHttpParams();
		params.setParameter("messageid", id);
		request.setParams(params);
		 
		HttpResponse response = null;
		try { 
			response = client.execute(request);
		} 
		catch (HttpHostConnectException e) {
			AndroidLogging.getInstance().error("HTTP Problem: " + e);
			return false; 
		} 
		if (response.getStatusLine().getStatusCode() == 200)
			return true; 
		AndroidLogging.getInstance().error("HTTP Problem: Got errror code " + response.getStatusLine().getStatusCode());