随笔分类 - android
android
摘要:GET: 1 public static String loginByGet(String username,String password){ 2 try { 3 //定义路径 4 String path="http://192.168.1.102:8084/androidServer/loginServlet?username=" 5 +URLEncoder.encode(URLEncoder.encode(username,"UTF-8"), "UTF-8")+"&password="...
阅读全文
摘要:方案一:GET:POST对于中文字段,客户端使用URLEncoder.encode()方法进行一次编码服务器使用:String data=new String(request.getParameter("title").getBytes("ISO-8859-1"),"UTF-8");解码个人觉得这种方法挺麻烦的,喜欢采用方案二方案二:GET:客户端使用URLEncoder.encode(URLEncoder.encode(username,"UTF-8"), "UTF-8")对中文字段进行两次编
阅读全文

浙公网安备 33010602011771号