我对AFNetworking有一个小问题。
我试图用POST参数简单调用一个路径(例如http://myserver.com/index.php ,参数myParam = 1)
我已经尝试过同时使用AFURLConnectionOperation和AFJSONRequestOperation,当我输出“请求”时,它显示{“myParam”:1},好像它将我的请求打包为json,实际上它应该是常规帖子(响应是JSON,但那不太相关)。
有没有人知道如何克服这个问题,除了使用NSURLConnection?
谢谢 :) 夏嘉曦
I'm having a small problem with AFNetworking.
Im trying to have a simple call to a path with POST parameters (e.g. http://myserver.com/index.php with parameters myParam=1)
I've tried using both AFURLConnectionOperation and AFJSONRequestOperation and on both when i output the "request", it shows {"myParam":1}, as if its packing my request as json, when actually it should be regular post (the response is JSON , but thats less relevant).
Does anyone know how to overcome this issue except for using NSURLConnection ?
Thank you :)Shai
最满意答案
只需在AFHTTPClient中将parameterEncoding设置为AFFormURLParameterEncoding即可
Just set parameterEncoding to AFFormURLParameterEncoding in your AFHTTPClient
更多推荐
发布评论