I have used many hours on how to solve this issue. Im using Restkit 0.9.3 with Object Mapping 2.0. All data is in JSON. I can make GET, POST, PUT and DELETE operations correctly, it’s the response body I dont catch and map corretly..
So my problem is that my restful api is returning errors when something goes wrong. I want to map those errors with restkit, fx this error is returned:
{
“code”: “401”,
“message”: “Unauthorized”
}
How do I map this json correct? I have tried lots of things and could use some guideness – or please give an example of this.
For version 0.10.0 this response error can be mapped as follows:
Requests that return an error will call the following delegate method: