zoukankan      html  css  js  c++  java
  • 调用第三方接口的具体代码


     private String getKobe(String mburl)
     {
           URL url = null;
           BufferedReader reader = null;
           String str="";
           try
           {
                   url = new URL(mburl);
                   reader = new BufferedReader(new InputStreamReader(url.openStream(),"UTF-8"));
                   String line=null;
                   do
                   {
                            line = reader.readLine();
                            if(line!=null)
                            {
                                    str +=line;
                            }
                    }
                    while(line!=null);
             }
             catch (Exception e)
            {
                   System.out.println("查询地址解析错误,"+e.getMessage());
                   return "callfail";
            } 
            finally
           {
                   if(reader != null)
                  {
                         try
                         {
                                 reader.close();
                         }
                         catch (IOException e)
                         {
                                  e.printStackTrace();
                         }
                    }
             }

              return str;

      }

  • 相关阅读:
    setInterval和setTimeOut方法—— 定时刷新
    json
    开发者必备的火狐插件
    C#泛型类和集合类的方法
    jQuery几种常用方法
    SQL语句优化技术分析
    索引的优点和缺点
    Repeater使用技巧
    jQuery 表格插件
    利用WebRequest来实现模拟浏览器通过Post方式向服务器提交数据
  • 原文地址:https://www.cnblogs.com/jirglt/p/2936292.html
Copyright © 2011-2022 走看看