afnetworking 返回响应头的处理

//发送验证码

            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);

            }];

posted @ 2016-08-25 15:41  foolish_love  阅读(200)  评论(0)    收藏  举报