捕获我在android studio中构建的应用程序中的http请求

问题描述 投票:0回答:1

我已经在android studio上创建了一个简单的网络视图应用。我想捕获它发出的所有http请求。请给我建议一些代码或方法。我不想使用像提琴手这样的第三方应用程序。它应该是一些代码来捕获我使用该应用程序发出的那些请求。

android android-studio http webview interceptor
1个回答
0
投票

正如您提到的代码和第三方应用程序一样,您在代码内和代码外都有两个选项:

OkHttpClient中的[https://square.github.io/okhttp/-用于捕获请求和响应。只需添加一个interceptor,就可以了。

[Network Profiler直接来自Android Studio https://developer.android.com/studio/profile/network-profiler-这是IDE中的内置工具,可帮助监视网络流量

© www.soinside.com 2019 - 2024. All rights reserved.