///********rest模拟数据解析*********///
AFHTTPRequestOperationManager * manager =[AFHTTPRequestOperationManager manager];
manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
[manager.requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[manager.requestSerializer setValue:@"751Pyh33qbd1kDQS" forHTTPHeaderField:@"Authorization"];
[manager GET:@"http://192.168.99.106:9090/plugins/restapi/v1/chatrooms" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
_chatArray = [responseObject objectForKey:@"chatRoom"];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"%@",error);
}];
网友评论