Notice
Recent Posts
Recent Comments
Link
관리 메뉴

설.현.아빠

Android HttpPost 본문

안드로이드/Http

Android HttpPost

설.현.아빠 2011. 2. 17. 16:52



ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();

 

nameValuePairs.add(new BasicNameValuePair("mb_id", "id"));
nameValuePairs.add(new BasicNameValuePair("mb_name", "name"));
nameValuePairs.add(new BasicNameValuePair("mb_nick", "nick"));

 

try{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.***.***/login.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
Log.i("POST_True","");
}
catch(Exception e)
{
Log.e("POST_Fail", e.toString());
}




http://blog.naver.com/toeab/40123394746

[출처] android httpPost|작성자 toeab



Comments