| | |
| | | * @purpose Created by Runt (qingingrunt2010@qq.com) on 2020-10-21. |
| | | */ |
| | | |
| | | public class HttpLoggingInterceptor extends EncryptInterceptor { |
| | | public class HttpLoggingInterceptor extends AddHeadersInterceptor { |
| | | |
| | | final String TAG = "HttpLogging"; |
| | | |
| | |
| | | try { |
| | | logArrays.addAll(getRequestLog(request)); |
| | | int position = logArrays.size() +2; |
| | | //request = encryptRequest(request);//加密 |
| | | response = chain.proceed(request); |
| | | logArrays.addAll(getResponseLog(response)); |
| | | NetWorkCost netWorkCost = NetWorkListenear.workCostMap.get(hashCode); |
| | |
| | | return response; |
| | | } |
| | | |
| | | /** |
| | | * 请求数据信息 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | private ArrayList<String> getRequestLog(Request request) throws IOException, JSONException { |
| | | RequestBody requestBody = request.body(); |
| | | ArrayList<String> logArrays = new ArrayList<>(); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 返回的数据信息 |
| | | * @param response |
| | | * @return |
| | | * @throws IOException |
| | | * @throws JSONException |
| | | */ |
| | | private ArrayList<String> getResponseLog(Response response) throws IOException, JSONException { |
| | | ArrayList<String> logArrays = new ArrayList<>(); |
| | | ResponseBody responseBody = response.body(); |