有没有办法找到HTTP请求和响应在Android上的全尺寸(用于数据使用情况跟踪)?没有办法、尺寸、情况、数据

2023-09-05 11:23:32 作者:我没哭只是睫毛......

我想跟踪我的应用程序的数据使用量,但要做到这一点,我需要能够得到一个 HttpUriRequest 和的Htt presponse 。简单地获取的 HttpEntity 是远远不够的,因为无论是请求和响应有更多的数据被传输(头,参数,可以传送实际的URL等)的大小。那么,有没有办法找到数据的正在被传送两种方式全款?

i would like to track the data usage of my app, but to do that, I need to be able to get the full size of an HttpUriRequest and HttpResponse. Simply getting the size of the HttpEntity isn't enough because both the request and response have more data being transferred (headers, params, the actual URL being transmitted, etc). So, is there a way to find the full amount of data that's being transmitted both ways?

感谢。

推荐答案

如果您只想指标事后你可以提供你自己的合适 ClientConnectionManager 实现子类并获取相关的 HttpConnectionMetrics

 
精彩推荐