AFNetWorking 2.0 使用

2018-07-20    来源:open-open

容器云强势上线!快速搭建集群,上万Linux镜像随意使用
/*
 {
    dqj = "454545\U5143";
    dz = "";
    id = 44;
    jpcs = "0\U6b21\U51fa\U4ef7";
    jssj = "2014-11-29 12:48:24";
    mc = 454545;
    qpj = "454545\U5143";
    tp = "http://122.225.106.234:8082/ProjectManage/UploadImages/1.png";
    zt = "\U8fdb\U884c\U4e2d";
}
 */
-(void) requestUseAFJSONRequest{
    NSURL *postUrl = [Tool generateURL2WithServer:api_server andApi:api_auction_list andEncode:NO];
     
    NSURLRequest *request = [NSURLRequest requestWithURL:postUrl];
     
    AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
    [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"Success: %@", operation.responseString);
         
        NSString *requestTmp = [NSString stringWithString:operation.responseString];
        NSData *resData = [[NSData alloc] initWithData:[requestTmp dataUsingEncoding:NSUTF8StringEncoding]];
        //系统自带JSON解析
        NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:resData options:NSJSONReadingMutableLeaves error:nil];
         
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Failure: %@", error);
        //        [SVProgressHUD dismissWithError:@"提交失败,请重试"];
    }];
    [operation start];
}

标签: seo

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。

上一篇:汉落塔算法实现代码

下一篇:Dijkstra算法