안드로이드에서 아래와 같이 작성햇는데 애러가 발생합니다
String strUrl = http://www.naver.com;
HttpClient client = new DefaultHttpClient();
String postUrl = strUrl;
HttpPost post = new HttpPost(postUrl);
List params = new ArrayList();
params.add(new BasicNameValuePair("test","cc"));
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params, HTTP.UTF_8);
post.setEntity(ent);
HttpResponse responsePost = client.execute(post); --> 에러발생
HttpEntity resEntity = responsePost.getEntity();
if(resEntity != null){
Log.w("Response", EntityUtils.toString(resEntity));
}
<uses-permission android:name="android.permission.INTERNET"/>
이것도 추가햇습니다
그런데 왜 에러가 날까요?