| | |
| | | * 获取refresh_token 值
|
| | | * @return
|
| | | */
|
| | | public String getAuth(){
|
| | | public String Auth(){
|
| | | String json = AuthService.getAuth();
|
| | | result = getGson().toJson(json);
|
| | | return SUCCESS;
|
| | |
| | | * @return
|
| | | */
|
| | | public String faceDetect(){
|
| | | String result = FaceDetect.faceDetect(json);
|
| | | result = getGson().toJson(result);
|
| | | String str = FaceDetect.faceDetect(json);
|
| | | result = null;
|
| | | result = getGson().toJson(str);
|
| | | return SUCCESS;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
|
| | | //String accessToken = "[调用鉴权接口获取的token]";
|
| | | String result = HttpUtil.post(url, map.get("accessToken").toString(), "application/json", param);
|
| | | System.out.println(result);
|
| | | return result;
|
| | | String msg = HttpUtil.post(url, map.get("accessToken").toString(), "application/json", param);
|
| | | |
| | | return msg;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | // 获取所有响应头字段
|
| | | Map<String, List<String>> headers = connection.getHeaderFields();
|
| | | // 遍历所有的响应头字段
|
| | | for (String key : headers.keySet()) {
|
| | | System.err.println(key + "--->" + headers.get(key));
|
| | | }
|
| | | // for (String key : headers.keySet()) {
|
| | | // System.err.println(key + "--->" + headers.get(key));
|
| | | // }
|
| | | // 定义 BufferedReader输入流来读取URL的响应
|
| | | BufferedReader in = null;
|
| | | in = new BufferedReader(
|
| | |
| | | while ((getLine = in.readLine()) != null) {
|
| | | result += getLine;
|
| | | }
|
| | | //System.out.println("&&&&&&&&&&&&&&&&&&&&&"+result);
|
| | | in.close();
|
| | | return result;
|
| | | }
|