AFNetworking post到后端,数据怎么调用

 let afn = AFHTTPRequestOperationManager afn.POST"http://api.abc.com//index.php?s=/home/order/makeorder.html",parameters: ["data":"22222"], success: { operation: AFHTTPRequestOperation!, responseObject: AnyObject! in print"%@", operation.request.allHTTPHeaderFields; let data = responseObject as! NSDictionary! print"获取数据==%@",data if data != nil { // let dict: NSDictionary = try! NSJSONSerialization.JSONObjectWithDatadata!, options: .AllowFragments as! NSDictionary // let modelTool = DictModelManager.sharedManager // let data = modelTool.objectWithDictionarydata, cls: FreshHot.self as? FreshHot // completiondata: data, error: nil } }, failure: { operation: AFHTTPRequestOperation!, error: NSError! in //Handle Error print"获取数据出错=%@",error; }

后台用php 拿到的$_POST 数据为

a:1:{s:4:"data";s:5:"22222";}

试着对$_Post unserialize,可是得不到数据,,

file_get_contentsphp://input 得到的的数据是

s:10:"data=22222";

请问PHP 改怎么处理AFNetworking post过来的数据?

发表评论

电子邮件地址不会被公开。 必填项已用*标注