I\'m using AFNetworking 2.0 to read JSON from a service I\'m building (on localhost
for now) in Node. Pretty normal stuff.
Node is sending JSON like so
Updated Solution for Swift.
If you are using AFNetworking in Swift. Then this solution might help you. It will accept most of the content types.
let manager=AFHTTPRequestOperationManager()
manager.responseSerializer = AFJSONResponseSerializer(readingOptions: NSJSONReadingOptions.AllowFragments) as AFJSONResponseSerializer
manager.requestSerializer = AFJSONRequestSerializer() as AFJSONRequestSerializer
manager.responseSerializer.acceptableContentTypes = NSSet(objects:"application/json", "text/html", "text/plain", "text/json", "text/javascript", "audio/wav") as Set