AFNetworking 2.0 Get JSON from code 400 in failure block

前端 未结 4 2016
长发绾君心
长发绾君心 2021-01-05 09:33

I\'m using AFHTTPRequestOperationManager for a POST request. Now I\'m deliberately entering incorrect information to handle a 400 erro

4条回答
  •  时光说笑
    2021-01-05 09:49

    Looking at the code for - responseObject, it appears that an HTTP error prevents it from being populated. You can grab the responseData directly and parse it yourself, but I would say this is either a bug or a good enhancement request. (It looks like - responseObject probably should be checking self.responseSerializationError, not self.error, when deciding if it should try to build a response object.)

提交回复
热议问题