开发者

can't use Http Post method in android application

HI,

I need to use http post method for web-service in android application .But in android shows error w开发者_开发问答hen use this method .How to use this method in application or any other equal method for replacing this http post method.

thanks, Lakshmanan.


URL url = new URL(my_ip_address);           
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestProperty("METHOD", "POST");
HttpURLConnection httpConnection = (HttpURLConnection)connection;
int responseCode = httpConnection.getResponseCode();

        if (responseCode == HttpURLConnection.HTTP_OK) {
  //do your stuff
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜