Android Volley gives me 400 error

后端 未结 12 2125
借酒劲吻你
借酒劲吻你 2020-12-11 00:28

I\'m trying to make a POST request to my API and it works in Postman (I get a valid JSON object), but not using Volley. With the follo

12条回答
  •  失恋的感觉
    2020-12-11 01:18

    I've got this error and now Iit's been fixed. I did what is told in this link. What you need to do is

    1. go to src/com/android/volley/toolbox/BasicNetwork.java
    2. Change the following lines
     if (statusCode < 200 || statusCode > 299) {
         throw new IOException();
     }
    

    with

     if (statusCode < 200 || statusCode > 405) {
         throw new IOException();
     }
    

    Hope this helps.

提交回复
热议问题