当前位置: 首页 > news >正文

比较好的网站开发框架wordpress对联

比较好的网站开发框架,wordpress对联,wordpress默认后台登陆,现在外贸做哪个网站好AFNetworking是一个为 iOS 和 Mac OSX 制作的令人愉快的网络库#xff0c;它建立在URL 装载系统框架的顶层#xff0c;内置在Cocoa里#xff0c;扩展了强有力的高级网络抽象。它的模块架构被良好的设计#xff0c;拥有丰富的功能#xff0c;因此#xff0c;使用起来… AFNetworking是一个为 iOS 和 Mac OSX 制作的令人愉快的网络库它建立在URL 装载系统框架的顶层内置在Cocoa里扩展了强有力的高级网络抽象。它的模块架构被良好的设计拥有丰富的功能因此使用起来必定赏心悦目。        原文链接https://github.com/AFNetworking/AFNetworking,我在此基础上了点配置修改        介绍   1.支持HTTP请求和基于REST的网络服务(包括GET、POST、 PUT、DELETE等)   2.支持ARC   3.要求iOS 5.0及以上版本   4.UIKit扩展        配置        1.下载AFNetworking,将2个文件夹:AFNetworking和UIKitAFNetworking拖入工程        2.导入以下库文件:CFNetwork、Security、SystemConfiguration、MobileCoreServices        3.如果你以前用的是1.0版本,那么AFNetworking 2.0 Migration Guide能帮助你        4.如果你是用CocoaPods配置的,那么            platform:ios,7.0            podAFNetworking,~2.0            使用            1.HTTP请求操作            AFHTTPRequestOperationManager封装的共同模式与web应用程序通过HTTP通信,包括创建请求,响应序列化,网络可达性监控、运营管理和安全,以及请求。            *GET请求   AFHTTPRequestOperationManager *manager [AFHTTPRequestOperationManager manager];[manager GET:http://example.com/resources.json parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(JSON: %, responseObject);} failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(Error: %, error);}];*POST请求   AFHTTPRequestOperationManager *manager [AFHTTPRequestOperationManager manager];NSDictionary *parameters {foo: bar};[manager POST:http://example.com/resources.json parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(JSON: %, responseObject);} failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(Error: %, error);}];*POST请求(多表)     AFHTTPRequestOperationManager *manager [AFHTTPRequestOperationManager manager];NSDictionary *parameters {foo: bar};NSURL *filePath [NSURL fileURLWithPath:file://path/to/image.png];[manager POST:http://example.com/resources.json parameters:parameters constructingBodyWithBlock:^(id formData) { [formData appendPartWithFileURL:filePath name:image error:nil];} success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(Success: %, responseObject);} failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(Error: %, error);}];2.AFURLSessionManager(NSURLSession详细见网络编程(6))              创建和管理制定的NSURLSession对象NSURLSessionConfiguration对象必须实现, , , 协议               *创建一个下载任务   NSURLSessionConfiguration *configuration [NSURLSessionConfiguration defaultSessionConfiguration];AFURLSessionManager *manager [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];NSURL *URL [NSURL URLWithString:http://example.com/download.zip];NSURLRequest *request [NSURLRequest requestWithURL:URL];NSURLSessionDownloadTask *downloadTask [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) { NSURL *documentsDirectoryURL [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]];} completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) { NSLog(File downloaded to: %, filePath);}];[downloadTask resume];*创建一个上传任务     NSURLSessionConfiguration *configuration [NSURLSessionConfiguration defaultSessionConfiguration];AFURLSessionManager *manager [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];NSURL *URL [NSURL URLWithString:http://example.com/upload];NSURLRequest *request [NSURLRequest requestWithURL:URL];NSURL *filePath [NSURL fileURLWithPath:file://path/to/image.png];NSURLSessionUploadTask *uploadTask [manager uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { if (error) { NSLog(Error: %, error); } else { NSLog(Success: % %, response, responseObject); }}];[uploadTask resume];*创建一个带多表,进度的上传任务     NSMutableURLRequest *request [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:POST URLString:http://example.com/upload parameters:nil constructingBodyWithBlock:^(id formData) { [formData appendPartWithFileURL:[NSURL fileURLWithPath:file://path/to/image.jpg] name:file fileName:filename.jpg mimeType:image/jpeg error:nil]; } error:nil];AFURLSessionManager *manager [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];NSProgress *progress nil;NSURLSessionUploadTask *uploadTask [manager uploadTaskWithStreamedRequest:request progress:progress completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { if (error) { NSLog(Error: %, error); } else { NSLog(% %, response, responseObject); }}];[uploadTask resume];*创建一个数据流Data任务     NSURLSessionConfiguration *configuration [NSURLSessionConfiguration defaultSessionConfiguration];AFURLSessionManager *manager [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];NSURL *URL [NSURL URLWithString:http://example.com/upload];NSURLRequest *request [NSURLRequest requestWithURL:URL];NSURLSessionDataTask *dataTask [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { if (error) { NSLog(Error: %, error); } else { NSLog(% %, response, responseObject); }}];[dataTask resume];3.网络监测(一般会用另一个网络监测类,Reachability,还有JSON解析方法,反正我也一般不用,自行脑补)                 AFNetworkReachabilityManager监控网络领域的可达性,WWAN地址和WiFi接口.                 *当前网络状态   [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { NSLog(Reachability: %, AFStringFromNetworkReachabilityStatus(status));}];*HTTP Manager 可达性     NSURL *baseURL [NSURL URLWithString:http://example.com/];AFHTTPRequestOperationManager *manager [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL];NSOperationQueue *operationQueue manager.operationQueue;[manager.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { switch (status) { case AFNetworkReachabilityStatusReachableViaWWAN: case AFNetworkReachabilityStatusReachableViaWiFi: [operationQueue setSuspended:NO]; break; case AFNetworkReachabilityStatusNotReachable: default: [operationQueue setSuspended:YES]; break; }}];4.AFHTTPRequestOperation                   AFHTTPRequestOperation是使用HTTP或HTTPS协议的AFURLConnectionOperation的子类。 它封装的获取后的HTTP状态和类型将决定请求的成功与否。虽然AFHTTPRequestOperationManager通常是最好的去请求的方式但是AFHTTPRequestOpersion也能够单独使用。                                *GET请求   NSURL *URL [NSURL URLWithString:http://example.com/resources/123.json];NSURLRequest *request [NSURLRequest requestWithURL:URL];AFHTTPRequestOperation *op [[AFHTTPRequestOperation alloc] initWithRequest:request];op.responseSerializer [AFJSONResponseSerializer serializer];[op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(JSON: %, responseObject);} failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(Error: %, error);}];[[NSOperationQueue mainQueue] addOperation:op];*批量多请求     NSMutableArray *mutableOperations [NSMutableArray array];for (NSURL *fileURL in filesToUpload) { NSURLRequest *request [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:POST URLString:http://example.com/upload parameters:nil constructingBodyWithBlock:^(id formData) { [formData appendPartWithFileURL:fileURL name:images[] error:nil]; }]; AFHTTPRequestOperation *operation [[AFHTTPRequestOperation alloc] initWithRequest:request]; [mutableOperations addObject:operation];}NSArray *operations [AFURLConnectionOperation batchOfRequestOperations:[...] progressBlock:^(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations) { NSLog(%lu of %lu complete, numberOfFinishedOperations, totalNumberOfOperations);} completionBlock:^(NSArray *operations) { NSLog(All operations in batch complete);}];[[NSOperationQueue mainQueue] addOperations:operations waitUntilFinished:NO];
http://www.ho-use.cn/article/10819774.html

相关文章:

  • 宁波网站怎么建设代做效果图网站
  • WordPress网站子目录访问阆中市住房和城乡建设局网站
  • 网站如何添加js代码网站开发时遇不到算法
  • 成都网站建设推广好电子商务毕业设计网站
  • 网站建设 英文北京建站模板制作
  • 建立网站需要多少钱一个班级网站设计模板
  • php做网站需要数据库吗上海中小企业网站建设
  • 个人做电子商务网站备案想要推广版
  • 江西哪里有做电商网站的公司网站做文献格式
  • 彩票网站net网站开发网站建设的原则
  • 设计师网站上海自己想注册公司怎么搞
  • 平面电商网站建设开发公司网签过期
  • 知名的传媒行业网站开发wordpress登录界面修改
  • 中国建设教育网官网是什么网站wordpress字体代码
  • 深圳网站建设一尘互联seo是什么专业的课程
  • 江西网站建设价位wordpress 网站关键词设置
  • 高权重网站做员会来顶排名wordpress极简名片主题
  • php电子商务网站模板宁波网站建设大概要多少钱
  • 重庆建站公司费用设计网页的步骤是什么
  • 医疗保险网站做钓鱼网站用哪种编程语言
  • 网站建设公司 跨界鱼科技专业什么网站可以做任务挣钱的
  • 关于企业的网站网站建设素材网页
  • 维护网站建设空间出租哪些大型网站用mysql
  • 厦门网站关键词优化chinacd wordpress99
  • 精品成品网站源码衡水企业网站建设报价
  • 网站建设公司专业公司哪家好网站的优化用什么软件下载
  • 小型教育网站建设问题存在的中粮我买网是哪个公司做的网站
  • 苏州婚庆公司网站建设案例网页微信电脑版
  • 福建网站建设制作网站建设流程及规范
  • 网站建设制作德州wordpress d8 4.1