且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android:Volley HTTP 请求自定义标头

更新时间:2022-01-31 07:26:30

JsonObjectRequest 扩展 JsonRequest 直接覆盖了 getBody() 方法,所以你的 getParam() 永远不会调用,我建议您扩展 StringRequest 而不是 JsonObjectRequest.

The JsonObjectRequest is extended JsonRequest which override getBody() method directly, so your getParam() would never invoke, I recommend you extend StringRequest instead of JsonObjectRequest.

您可以查看这个答案了解更多详情.

your can check this answer for more details.

顺便说一下,您还有另一种选择:基于 Volley 的 Netroid更多功能.

by the way, you've another choice : Netroid, that based Volley, offered more features at all.