반응형

//get방식
/*
HttpClient client = new DefaultHttpClient();
String url = "http://localhost:8080";
HttpGet get = new HttpGet(url);
HttpResponse response = client.execute(get);
HttpEntity resEntity = response.getEntity();
if(resEntity != null){
Log.w("reponse", EntityUtils.toString(resEntity));
}
*/



//post방식
/*
HttpClient client = new DefaultHttpClient();
String postUrl = "http://222.jsp";
HttpPost post = new HttpPost(postUrl);
List params = new ArrayList();
params.add(new BasicNameValuePair("deliveryDate", "1111111111"));

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));
}
*/

반응형

+ Recent posts