//获取url,api数据 public String getProviderOzMeg(String api_url){ try { URL url = new URL(api_url); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); String author = "Basic " + Base64Util.getBase64(Au_experienceozConfig.user_name_pro + ":" + Au_experienceozConfig.user_password_pro); conn.setRequestProperty("Authorization", author); conn.connect(); log.info("ResponseCode:"+conn.getResponseCode()); BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); String meg = br.readLine(); conn.disconnect(); return meg; } catch (Exception e) { return null; } }
时间: 2024-11-13 09:00:25