1. 程式人生 > >Get請求引數中有中文,程式碼報錯解決方式

Get請求引數中有中文,程式碼報錯解決方式

String url="http://portal.dsjhs.com/apis/HsCdis/get/getLoginName?userIdcardNum=450311197509084501&userName=";
        
        String param= URLEncoder.encode("李青","UTF-8");
        String finaURL=url+param+"&userPhone=18171686967";