Let me ask you a question.
Backstage let me take the request parameter into a body into a JSON string into the body passed to him, of course, the header is set, set up in advance,
But then it became known that the essence of turning entities into JSON strings was to first convert entities to dictionaries or arrays and then use
NSData *jsondata = [nsjsonserialization datawithjsonobject:model options:nsjsonwritingprettyprinted Error:nil];
//
NSString *jsonstr = [[NSString alloc] Initwithdata:jsondata encoding:nsutf8stringencoding];
The above two lines of code parse the conversion to get a really good JSON string.
But the problem arises, the output of the log JSON string before each pass is no problem, but to the server, there is a JSON string before the equal sign,
=%3c7b0a2020%2022706173%2073776f72%206422203a%2020223132%2033343536%20222c0a20%2020227573%2065724e61% 206d652220%203a202231%2033323431%2035383235%203233220a%207d%3e
The background cannot parse.
I found the reason for finding AFN bottom.
AFURLREQUESTSERIALIZATION.M 508 Lines
query = afquerystringfromparameters (parameters); The clear output has changed our JSON (why it changed).
Solutions
Afhttpsessionmanager 267 Line method to add
[Request Sethttpbody:parameters]; (I don't know why),
But until now, the data has not yet been changed to the previous JSON string to the JSON stream is deleted nsstring *jsonstr = [[NSString alloc] Initwithdata:jsondata encoding:nsutf8string Encoding];
But I'm using ytknetwork, so I changed.
YTKNETWORKAGENT.M 167 line Sessiontaskforrequest into the response post (can be get if needed), that is, 457 lines
In the Datataskwithhttpmethod method, add
[Request Sethttpbody:parameters]; This line of code
It's finally over.
iOS pass JSON string there's an equal sign in front of you.