| | |
| | | RequestBody requestBody = FormBody.create(MediaType.parse("application/json; charset=utf-8"), getJson(json)); |
| | | final Request request = new Request.Builder() |
| | | .url(fullUrl)//请求的url// |
| | | .addHeader("Authorization", UserConfigManage.getInstance().getHeaderPrefix()+UserConfigManage.getInstance().getToken()) |
| | | .addHeader("Authorization", UserConfigManage.getInstance().getHeaderPrefix() + UserConfigManage.getInstance().getToken()) |
| | | .post(requestBody) |
| | | .build(); |
| | | if (isExecute) { |
| | |
| | | String s = Objects.requireNonNull(response.body()).string(); |
| | | HttpResponsePack httpResponsePack = new Gson().fromJson(s, HttpResponsePack.class); |
| | | baseSuccessCallBeak.onSuccess(httpResponsePack); |
| | | HdlLogLogic.print("http->回复->", response.request().url()+"\r\n" + s); |
| | | HdlLogLogic.print("http->回复->", response.request().url() + "\r\n" + s); |
| | | } else { |
| | | //throw new IOException("Unexpected code " + response); |
| | | baseSuccessCallBeak.onFailure(new Exception()); |