ios - AFNetworking alters JSON response? -



ios - AFNetworking alters JSON response? -

i want utilize afnetworking communicating restful webservice. json response, reason different webservice sent.

my code:

let manager = afhttprequestoperationmanager() var contenttypes:nsmutableset = manager.responseserializer.acceptablecontenttypes.mutablecopy() nsmutableset contenttypes.addobject("text/html") manager.responseserializer.acceptablecontenttypes = contenttypes.copy() nsset var parameters = ["format":"json"] manager.get( "http://www.raywenderlich.com/demos/weather_sample/weather.php", parameters: parameters, success: { (operation: afhttprequestoperation!,responseobject: anyobject!) in println("json: " + responseobject.description string) }, failure: { (operation: afhttprequestoperation!,error: nserror!) in println("error: " + error.localizeddescription) })

the json should this: http://www.raywenderlich.com/demos/weather_sample/weather.php?format=json

but reason println prints this:

{ info = { "current_condition" = ( { cloudcover = 16; humidity = 59; "observation_time" = "09:09 pm"; ...

the : replaced =, [] () , of " gone.

does know reason this?

because isn't printing json, it's printing object graph generated json (a combination of instances of nsarray, nsdictionary, nsstring, ...).

i.e. afnetworking has done bunch of work deserialise info received.

ios swift afnetworking-2

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -