You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you wish to use any interceptor, other than Okhttp or Ktor, Pluto provides way to capture network logs.
66
+
```kotlin
67
+
/* create interceptor */
68
+
val networkInterceptor =NetworkInterceptor.intercept(
69
+
NetworkData.Request(....),
70
+
NetworkInterceptor.Option()
71
+
)
72
+
73
+
/**
74
+
* wait for the network call to complete
75
+
**/
76
+
77
+
/* if error */
78
+
networkInterceptor.onError(exception)
79
+
80
+
/* if success */
81
+
networkInterceptor.onResponse(
82
+
NetworkData.Response(....)
83
+
)
84
+
```
85
+
36
86
🎉 You are all done!
37
87
38
88
Now re-build and run your app and open Pluto, you will see the Network plugin installed.
@@ -45,13 +95,3 @@ To open Network plugin screen via code, use this
45
95
Pluto.open(PlutoNetworkPlugin.ID)
46
96
```
47
97
<br>
48
-
49
-
### Log Custom Network traces
50
-
PlutoInterceptor works with OkHttp based interceptors, but to allow non-OkHttp based interceptors to track network calls Pluto provides utility to log network calls manually.
51
-
```kotlin
52
-
PlutoNetwork.logCustomTrace(
53
-
request =CustomRequest(),
54
-
response =CustomResponse()
55
-
)
56
-
```
57
-
Once logged successfully, the network call trace will appear in the network call list.
0 commit comments