从Volley获取HTTP响应状态消息

时间:2018-06-25 16:48:05

标签: android android-volley

在Android Volley库中,它使人们可以使用networkResponse.statusCode方法调用来获取状态代码。但是,有没有办法在HTTP错误调用中获取服务器返回的特定错误消息?例如如果错误代码为403: You are not allowed to perform this request. Please log in again,则如何提取该消息不允许您执行此请求。请从Volley错误响应中再次登录?在这种情况下,networkResponse.data始终为空。

0 个答案:

没有答案