http 요청2 http request First of all, request a permission to access network, add following to your manifest:Then the easiest way is to use Apache http client bundled with Android: HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = httpclient.execute(new HttpGet(URL)); StatusLine statusLine = response.getStatusLine(); if(statusLine.getStatusCode() == HttpStatus.SC_OK){ ByteArrayOutputStream out = .. 2015. 12. 15. http post get 전송 1.Get 방식 example) { ... String result = sendData("http://xxx.xxx.xxx/xxx.asp?title=leeminjung&type=article"); ... } private static String sendData(String addr){ StringBuilder html = new StringBuilder(); try{ URL url = new URL(addr); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); if(conn != null){ conn.setConnectTimeout(10000); conn.setUseCaches(false); if(conn.getResponseCode(.. 2015. 12. 15. 이전 1 다음