AFNetworking怎么post x-www-form-urllib.urlencodeed类型的数据

application/x-www-form-urlencoded类型数据如何用post提交_百度知道
application/x-www-form-urlencoded类型数据如何用post提交
怎么填写post参数.参数 附加协议头, 文本型, 可空.参数 提交信息, 文本型, 可空, &POST&专用
我有更好的答案
按默认排序
什么语言?
其他类似问题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁iOS 问题:AFNetworking中POST数据,在服务器端获取不到POST的内容,不清楚为何。另外一个Project中差不多的代码就工作正常。。
服务器端检测REQUEST_METHOD总是显示GET。。。到底哪里有问题了。。郁闷了。。
NSURL *url = [NSURL URLWithString:kBASEURL];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSString *_path=@"/app_api/test.php";
NSDictionary *paras = [[NSDictionary alloc]initWithObjectsAndKeys:@"test",@"replyContent",@"1111",@"topicid", nil];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:_path parameters:paras];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation
setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *html = operation.responseS
NSLog(@"html:%@",html);
NSDictionary *dict = [[NSDictionary alloc]init];
= [html objectFromJSONString];
completionBlock(dict);
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
failureBlock(error);
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[queue addOperation:operation]; -
AFNetworking中POST数据,在服务器端获取不到POST的内容,不清楚为何。另外一个Project中差不多的代码就工作正常。。
服务器端检测REQUEST_METHOD总是显示GET。。。到底哪里有问题了。。郁闷了。。
NSURL *url = [NSURL URLWithString:kBASEURL];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSString *_path=@"/app_api/test.php";
NSDictionary *paras = [[NSDictionary alloc]initWithObjectsAndKeys:@"test",@"replyContent",@"1111",@"topicid", nil];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:_path parameters:paras];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation
setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSString *html = operation.responseS
NSLog(@"html:%@",html);
NSDictionary *dict = [[NSDictionary alloc]init];
= [html objectFromJSONString];
completionBlock(dict);
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
failureBlock(error);
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[queue addOperation:operation];
共有 6 个回答
问题解决。是服务器配置问题。。。。=.=
登录后方可回复
@M先森 : 行行好,能不能说下 ,具体是哪个配置呢?
登录后方可回复
亲,能说下是哪个配置问题吗?我也遇到了相到的问题,谢谢!!!!
登录后方可回复
@Cookie : 时间太久,不记得了。。。抱歉。
登录后方可回复
我也遇到同样的问题了,服务端接收不到数据,报空指针,不过我用的是AFHTTPRequestOperation这个类来POST 的。。
登录后方可回复
@zhangh_bxj :
: 行行好,能不能说下 ,之后是怎么解决的
登录后方可回复
登录后方可回答
耗时 0.1464 秒}

我要回帖

更多关于 urlencode解码 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信