post 事儿 《笔记篇》

[XPFHttpRequest postWithURLString:str parameters:parameters success:^(id responseObject) {

// 有时候返回16 所有要转换成 字典;

//<7b227265 74636f64 65223a32 3030302c 226d7367 223a22e6 b7bbe58a a0e68890 e58a9f21 222c2264 61746122 3a5b5d7d>

NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];

if ([[dic objectForKey:@"retcode"] isEqual:@2000]) {

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:[dic objectForKey:@"msg"]    preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction * action = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault  handler:nil];

[alert addAction:action];

[self presentViewController:alert animated:YES completion:nil];

}else {

XPFLog(@" 师傅我看见你了 123");

}

XPFLog(@" 师傅我看见你了");

} failure:^(NSError *error) {

XPFLog(@"123");

}];

你可能感兴趣的:(post 事儿 《笔记篇》)