I'm using AFNetworking to handle a reset password request from my mobile app to my rails server.
The api is returning: head :ok (results in a 200)
However, this is causing AFNetworking to run the failure block when I issue a getPath
request.
I can do two things to have the success block run:
- have the api return
head :no_content
(results in a 204) - don't set my Accept header to `application/json'
It seems like AFNetworking is expecting at least an empty array when the status code is 200 and the Accept header is application/json
.
I don't have full control over the api, so is it possible to have a 200 with no content still trigger my success block, or is the 204 supposed to be used for this exact situation, where it's successful but nothing will be returned from the server?
Thanks!