AFNetworking/AFNetworking — pull request #1226 by subdigital (2013-08-18 01:18:31+00:00)
Title: Failure callbacks

This PR adds back in the `NSHTTPURLResponse` object as well as the raw `responseObject` that was returned from the server to `AFHTTPClient`.

This relates to #1225 where I was talking about needing to know the actual response of the server in the event of a non 2xx response.

A common case would be to look at the status code and treat the `responseObject` accordingly. For a 500, you can't trust it and probably should interpret it. For a 404, well that's obvious. For other 400 level errors often times you can try to parse the response as JSON so you can get a reason for the error.

As for the implementation, I took the liberty of adding a typedef for the block signatures to make it a bit easier on the eyes. Let me know if you don't care for this.