简体   繁体   English

Android Volley Caching-通过URL和请求正文获取响应

[英]Android Volley Caching - Get Response by URL and Request Body

From my experimenting so far, it appears that Volley accesses its cache based on the URL alone. 从到目前为止的实验来看,Volley似乎仅基于URL访问其缓存。 I would like to know if it also can determine which response it should return based on the combination of URL and request body data. 我想知道它是否还可以基于URL和请求正文数据的组合来确定应返回哪个响应。

Is there a setting for this, or and extension point where I can implement this myself. 是否有此设置,或者我可以自己实现的扩展点?

I don't see anywhere that the request body data is returned in the NetworkResponse object, or I would do the check in the parseNetworkResponse method. 我看不到NetworkResponse对象返回请求正文数据的任何地方,或者我将在parseNetworkResponse方法中进行检查。

Thanks 谢谢

在实现自定义请求时,必须重写Request.getCacheKey()方法以包括请求主体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM