博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
AFNetWorking 2.0 使用
阅读量:6991 次
发布时间:2019-06-27

本文共 1339 字,大约阅读时间需要 4 分钟。

hot3.png

1 用法1

/* {    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];}

转载于:https://my.oschina.net/bingshanguxue/blog/360947

你可能感兴趣的文章
为啥大数据帮不了你找到女朋友
查看>>
Firefox减少对Adobe Flash的使用
查看>>
信而泰推出100G五速卡补通信测试短板
查看>>
IBM高管:苹果设备在企业市场“无处不在”
查看>>
大数据:算得出数字,算不出人性
查看>>
ARM Cortex-R8处理器开拓5G速度需求
查看>>
《Linux高性能服务器编程》——3.6 TCP交互数据流
查看>>
14个最聪明的生活小窍门,省钱又实用
查看>>
《R语言编程艺术》——2.11 向量元素的名称
查看>>
钱多了也发愁 亚马逊掌门贝索斯捐款无门向网友求救
查看>>
苹果公司的数据中心到底使用了多少水?
查看>>
阿里牵头研制“大数据安全能力成熟度模型”国家标准
查看>>
飞信回归,企业版正式上线,下一个羊毛党是你吗?
查看>>
2016中国大数据产业博览会暨高峰论坛
查看>>
卡巴斯基发现网页技术中的危险漏洞
查看>>
医疗行业十大热门趋势之六:网络安全
查看>>
买新不买旧?选购固态硬盘的几点建议
查看>>
大数据精准营销必读的“三步曲”及“两误区“
查看>>
Cray:XC50提供了最高密度的性能
查看>>
Dropbox活得挺好:去年招了500人 还有大把现金
查看>>