首页 > Web开发 > 详细

AFNetworking HTTP响应头返回数据

时间:2015-08-21 13:05:27      阅读:260      评论:0      收藏:0      [点我收藏+]

//发送验证码

            NSLog(@"发送验证码");

            AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

            NSMutableDictionary *sendDict = [[NSMutableDictionary alloc ]init];

            

            [sendDict setValue:_phoneTextField.text forKey:@"mobile"];

            

            [manager POST:[NSString stringWithFormat:@"%@%@",HOST_URL,REGISTER_TEST_URL] parameters:sendDict success:^(AFHTTPRequestOperation *operation, id responseObject) {

                     //这里是判断响应头返回的数据

                if (operation.response.statusCode==200) {

                    [self success:responseObject];

                }else{

                    //提醒框

                    UIAlertView *alter = [[UIAlertView alloc] initWithTitle:nil message:@"发送失败" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];

                    [alter show];

                }

                

            } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

                NSLog(@"%@",error.description);

            }];

 

AFNetworking HTTP响应头返回数据

原文:http://www.cnblogs.com/-yun/p/4747189.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!