I am wondering what the “default” response from a “DELETE /api/myEntity/1” request is RestKit expecting.
My current web service returns OK (200) status code with empty body. Meaning that the object was successfully deleted.
RestKit triggers the onDidFailWithError method, and also logs some messages to the debug output:
restkit.network:RKObjectLoader.m:300 Unable to find parser for MIME Type 'text/plain'
restkit.network:RKObjectLoader.m:329 Encountered unexpected response with status code: 200 (MIME Type: text/plain ->
The web service is developed by us. So we can return anything else, we just think returning “OK” is enough.
Please advise. Thanks.
For all empty responses the correct status code to be returned should be 204 No Content.
RestKit declares to correctly handle also 200 OK but I experienced some problem with delete, too.
I found some bux fixes done after tag v0.10.3 (see here) so I suggest you to upgrade to a more recent commit.
Be careful to update to newer v0.20 because it is an hard refactoring and a lot of things were changed!