During these days development, when I connect our iOS App to Python
AFNetworking, I met an error. It is my first time to use the
AFNetworking framework, I am used to use
MKNetworking instead, but with some reasons. I planned to use
AFNetworking instead. And then, as you see, I met a few problems.
At first, I do not know, what it's mean, but I ask my partner, he tells me, in order to beautify the
JSON he use some method, to make them like this, I do not know exactly what he did, but
JSON looks like this.
It is not like the
JSON I used to deal with before, I think they should be this shape:
But it's not, at that time, he explains that if I could not deal with this, he could modify them back. For he can not change this immediately, so I tried to fix this problem.
And then, I find this problem is cuz but my mistakes, I add one more
/ in the
URL. After I fix this. I confidently run my App, and there is also an different error:
I search this on google and stackoverflow, someone says add a
responseSerialzer, someone says to
responseSerailize and change it option to
AllowFragment. When I tries them, I find the first solution is right.
I add a
acceptableContentType to the
responseSerializer, and I fix this. But I think this quiet messy, everytime I use this framework, I had to add an
acceptableContentType. I am too naive to realize this as a mistake. So I open an
AFNetworking and add this
text/html to the source code.
And soon, the author of
AFNetworking reply me as follows:
A little disappointed, but I add this type to my source code, in order to not add this everytime initialize the
Hope this helps.