这个封装类包含了GET请求,POST请求,上传图片,上传多张图片,下载图片,判断网络是否可用等功能。
创新互联建站制作网站网页找三站合一网站制作公司,专注于网页设计,成都网站设计、做网站,网站设计,企业网站搭建,网站开发,建网站业务,680元做网站,已为数千家服务,创新互联建站网站建设将一如既往的为我们的客户提供最优质的网站建设、网络营销推广服务!#import@interface HttpUtil : NSObject typedef NS_ENUM(NSInteger, NetworkReachabilityStatus) { NetworkReachabilityStatusUnknown = -1, NetworkReachabilityStatusNotReachable = 0, NetworkReachabilityStatusReachableViaWWAN = 1, NetworkReachabilityStatusReachableViaWiFi = 2, }; // GET请求 + (void)getWithURLString:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSError * error))failure; // POST请求 + (void)postWithURLString:(NSString *)URLString parameters:(id)parameters success:(void (^)(id))success failure:(void (^)(NSError *))failure; // 上传图片 + (void)uploadWithURLString:(NSString *)URLString parameters:(id)parameters uploadData:(NSData *)uploadData uploadName:(NSString *)uploadName success:(void (^)())success failure:(void (^)(NSError *))failure; // 上传多张图片 + (void)uploadMostImageWithURLString:(NSString *)URLString parameters:(id)parameters uploadDatas:(NSArray *)uploadDatas uploadName:(NSString *)uploadName success:(void (^)())success failure:(void (^)(NSError *))failure; +(void)DownLoadWithUrlString:(NSString *)URLString parameters:(id)parameters progress:(void (^)(id))progress success:(void(^)(NSURL *filePath))success; +(void)setReachabilityStatusChangeBlock:(void(^)(NetworkReachabilityStatus status))block; +(void)stopMonitoring; +(Boolean)JudgeNetisConnect; @end
另外有需要云服务器可以了解下创新互联建站www.cdcxhl.com,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。