| | |
| | | Response response = client.newCall(request).execute();
|
| | | return response.body().string();
|
| | | } catch (IOException e) {
|
| | | System.out.println(e.getMessage());
|
| | | System.out.println("异常:"+aurl+","+e.getMessage());
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public String getAgentMessage(String aurl) {
|
| | | try {
|
| | |
|
| | | System.out.println("接口请求地址:"+aurl );
|
| | | OkHttpClient client = new OkHttpClient.Builder().connectTimeout(0, TimeUnit.SECONDS)
|
| | | .readTimeout(0, TimeUnit.SECONDS)
|
| | | .writeTimeout(0, TimeUnit.SECONDS)
|
| | |
| | | Response response = client.newCall(request).execute();
|
| | | return response.body().string();
|
| | | } catch (IOException e) {
|
| | | System.out.println(e.getMessage());
|
| | | System.out.println("异常:"+aurl+","+e.getMessage());
|
| | | return null;
|
| | | }
|
| | |
|
| | |
| | | Response response = client.newCall(request).execute();
|
| | | return response.body().string();
|
| | | } catch (IOException e) {
|
| | | System.out.println(e.getMessage());
|
| | | System.out.println("异常:"+aurl+","+e.getMessage());
|
| | | return null;
|
| | | }
|
| | | // return null;
|
| | | }
|
| | |
|
| | | public String getPostAccount(String aurl, HashMap<String, String> parms) {
|
| | | try {
|
| | | FormBody.Builder builder = new FormBody.Builder();
|
| | | for (String key : parms.keySet()) {
|
| | | builder.add(key, parms.get(key));
|
| | | }
|
| | | RequestBody requestBody = builder.build();
|
| | | OkHttpClient client = new OkHttpClient.Builder().connectTimeout(0, TimeUnit.SECONDS)
|
| | | .readTimeout(0, TimeUnit.SECONDS)
|
| | | .writeTimeout(0, TimeUnit.SECONDS)
|
| | | .build();
|
| | | Request request = new Request.Builder()
|
| | | .url(aurl)
|
| | | .post(requestBody)
|
| | | .build();
|
| | | Response response = client.newCall(request).execute();
|
| | | return response.body().string();
|
| | | } catch (IOException e) {
|
| | | System.out.println("异常:"+aurl+","+e.getMessage());
|
| | | return null;
|
| | | }
|
| | | // return null;
|
| | | }
|
| | | public String postAgentMessage(String aurl, Map<String, String> parms) {
|
| | | try {
|
| | | String axiosUrl = xzConfig.agentUrl + aurl;
|
| | |
| | | Response response = client.newCall(request).execute();
|
| | | return response.body().string();
|
| | | } catch (IOException e) {
|
| | | System.out.println(e.getMessage());
|
| | | System.out.println("异常:"+aurl+","+e.getMessage());
|
| | | return null;
|
| | | }
|
| | | // return null;
|