91亚洲精华国内精华精华液_国产高清在线精品一区不卡_精品特级一级毛片免费观看_欧美日韩中文制服有码_亚洲精品无码你懂的网站369

/**
      * 訪問數(shù)據(jù)庫并返回JSON數(shù)據(jù)字符串
      *
      * @param params 向服務(wù)器端傳的參數(shù)
      * @param url
      * @return
      * @throws Exception
      */
     public static String doPost(List params, String url)
             throws Exception {
         String result = null;
         // 獲取HttpClient對(duì)象
         HttpClient httpClient = new DefaultHttpClient();
         // 新建HttpPost對(duì)象
         HttpPost httpPost = new HttpPost(url);
         if (params != null) {
             // 設(shè)置字符集
             HttpEntity entity = new UrlEncodedFormEntity(params, HTTP.UTF_8);
             // 設(shè)置參數(shù)實(shí)體
             httpPost.setEntity(entity);
         }

         /*// 連接超時(shí)
         httpClient.getParams().setParameter(
                 CoreConnectionPNames.CONNECTION_TIMEOUT, 3000);
         // 請(qǐng)求超時(shí)
         httpClient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,
                 3000);*/
         // 獲取HttpResponse實(shí)例
         HttpResponse httpResp = httpClient.execute(httpPost);
         // 判斷是夠請(qǐng)求成功
         if (httpResp.getStatusLine().getStatusCode() == 200) {
             // 獲取返回的數(shù)據(jù)
             result = EntityUtils.toString(httpResp.getEntity(), "UTF-8");
         } else {
             Log.i("HttpPost", "HttpPost方式請(qǐng)求失敗");
         }

         return result;
     }

 

 

 

其次Json數(shù)據(jù)解析:
json數(shù)據(jù): [{"id":"67","biaoTi":"G","logo":"http://www.nuoter.com/wtserver/

resources/upload/13508741845270.png","logoLunbo":"http://www.nuoter.com/

wtserver/resources/upload/13509015004480.jpg","yuanJia":"0","xianJia":"0"},{"id":"64","bi

aoTi":"444","logo":"http://www.nuoter.com/wtserver/resources/upload/13508741704400.png"

"logoLunbo":"http://172.16.1.75:8080/wtserver/resources/upload/13508741738500.png","yuanJia":

"0","xianJia":"0"},{"id":"62","biaoTi":"jhadasd","logo":"http://www.nuoter.com/wtserver/resources/uplo

ad/13508741500450.png","logoLunbo":"http://172.16.1.75:8080/wtserver/resources/upload/13508741557450.png",

"yuanJia":"1","xianJia":"0"}]

 

 

 

穩(wěn)定

產(chǎn)品高可用性高并發(fā)

貼心

項(xiàng)目群及時(shí)溝通

專業(yè)

產(chǎn)品經(jīng)理1v1支持

快速

MVP模式小步快跑

承諾

我們選擇聲譽(yù)

堅(jiān)持

10年專注高端品質(zhì)開發(fā)
  • 返回頂部