Skip to content

Instantly share code, notes, and snippets.

@ddonovan
Created October 19, 2014 03:54
Show Gist options
  • Save ddonovan/c14dd1195623d04d952e to your computer and use it in GitHub Desktop.
Save ddonovan/c14dd1195623d04d952e to your computer and use it in GitHub Desktop.
sample of how to configure AFNetworking to allow http response codes other than 200 as an acceptable success, which allow the data sent from the server to be serialized to json.
NSMutableIndexSet *mutableIndexSet = [[NSMutableIndexSet alloc] initWithIndexesInRange:NSMakeRange(200, 100)];
[mutableIndexSet addIndex:401];
[mutableIndexSet addIndex:403];
_sharedClient.responseSerializer.acceptableStatusCodes = mutableIndexSet;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment