Download Sample Project

package javaapplication1;

import java.util.logging.Logger;
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.PostMethod;

public class Main {
 private final static Logger LOGGER = Logger.getLogger(Main.class.getName());

 public static void main(String args[]) {
  try {
   PostMethod post = new PostMethod("http://23.21.69.166/ralapanawa/RalaWS.php");
   post.addParameter("tank_id", "kalawewa");
   HttpClient client = new HttpClient();
   int status = client.executeMethod(post);
   String response = post.getResponseBodyAsString();
   LOGGER.info("Request sent! > Reponse : " + response);

  } catch (Exception e) {
   LOGGER.info("Error : " + e.getMessage());
  }
 }
}