목록안드로이드 (401)
설.현.아빠
질문 안녕하세요 HttpPost 할때 한글보내면 깨지는군요 ㅠㅠ 안깨지고 보낼려면 어떻게 해야 하는지 아시는분 계신가요? 답변 인코딩 하세요 UrlEncodedFormEntity ent = new UrlEncodedFormEntity(params,HTTP.UTF_8); 이런식
질문 final HttpPost post = new HttpPost("http://jungootesting.appspot.com/upload.php"); final File file = getFileStreamPath("sensors.log"); if (file.exists() && file.length() > 10) { // The file exists and contains a non-trivial amount of information final FileEntity entity = new FileEntity(file, "text/plain"); for (Map.Entry entry : headers.entrySet()) { post.setHeader("x-" + entry.getKey(), entr..
*. 소스보기 import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.Http..
만약 내가 보내야 하는 parameter가 255자 이상이라면 get방식으로 parameter를 넘길 수 없다. get방식은 글자 제한수가 있기 때문이다. 이럴때는 post 방식으로 보내야 한다. http://blog.naver.com/sanjuggu/90105935195
http://blog.naver.com/yhcyksyh/40118227641 http://stackoverflow.com/questions/3046424/http-post-requests-using-httpclient-take-2-seconds-why
ArrayList nameValuePairs = new ArrayList(); 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(nameV..
http://www.androidsnippets.org/snippets/36/