skip to main |
skip to sidebar
RSS Feeds
Nope. nothing .. just some random thoughts come to my mind ...
Nope. nothing .. just some random thoughts come to my mind ...
3:35 PM | Wednesday, July 4, 2012
Posted by harshadura
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());
}
}
}
Post a Comment