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;

      }

  • 相关阅读:
    查询自动生成Guid列
    Appium运行时报does not have permission android.permission.CLEAR_APP_USER_DATA to clear data
    小米手机
    SoapUI简介和入门实例解析
    Postman高级应用——流程控制、调试、公共函数、外部数据文件
    Postman高级应用——串行传参和动态传参详解
    Fiddler抓包工具使用详解
    接口测试简介
    soapui基础知识
    接口测试文档规范
  • 原文地址:https://www.cnblogs.com/jirglt/p/2936292.html
Copyright © 2011-2022 走看看