File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
app/src/main/java/fr/free/nrw/commons/mwapi Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
public class NetworkInterceptors {
18
18
19
+ /**
20
+ * Interceptor to log the HTTP request
21
+ */
19
22
@ NonNull
20
23
public static HttpRequestInterceptor getHttpRequestInterceptor () {
21
24
return (HttpRequest request , HttpContext httpContext ) -> {
@@ -30,6 +33,10 @@ public static HttpRequestInterceptor getHttpRequestInterceptor() {
30
33
};
31
34
}
32
35
36
+ /**
37
+ * Log all request params from a HTTPRequest
38
+ * @param request
39
+ */
33
40
private static void logRequestParams (HttpRequest request ) {
34
41
Set <String > names = new HashSet <>();
35
42
if (request .getParams () instanceof ClientParamsStack ) {
@@ -62,6 +69,10 @@ private static void logRequestParams(HttpRequest request) {
62
69
Timber .v ("<<<<<<<<<<<<<< REQUEST PARAMS >>>>>>>>>>>>" );
63
70
}
64
71
72
+ /**
73
+ * Log all headers from a HTTPRequest
74
+ * @param request
75
+ */
65
76
private static void logRequestHeaders (HttpRequest request ) {
66
77
Header [] headerFields = request .getAllHeaders ();
67
78
You can’t perform that action at this time.
0 commit comments