WTRequestCenter GET 请求

程序名称:WTRequestCenter GET 请求

授权协议: Apache

操作系统: iOS

开发语言: Objective-C

WTRequestCenter GET 请求 介绍

WTRequestCenter 是一个网络请求类库库,所有的请求都是缓存的。

GET 请求

[WTRequestCenter getWithURL:url
                 parameters:parameters
          completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
              id obj = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&jsonError];
              NSLog(@"result:%@",obj);
              }

POST
请求

[WTRequestCenter postWithURL:url
                  parameters:parameters 
           completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
                     id obj = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&jsonError];
              NSLog(@"result:%@",obj);
               }

缓存图片

    NSURL *url = [NSURL URLWithString:@"http://www.xxx.com/eqdsa.jpg"];
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectZero];
    [WTRequestCenter getimageWithURL:url imageComplectionHandler:^(UIImage *image) {
        imageView.image = image;
    }];

取消所有请求

[WTRequestCenter cancelAllRequest];

WTRequestCenter GET 请求 官网

https://github.com/swtlovewtt/WTRequestCenter

相关编程语言

Acapela TTS 是一个为 iPhone 和 iPad 开发的 TTS 引...
二维码(QR Code)扫描静态库,扫描效率较高。
RegexKitLite 是一个轻量级的 Objective-C 的正则表...
一款基于ASIHttpReques开源的仿迅雷多线程断点续传功...
实现动态检测网络(wifi)状况,不需要用户手动刷新...
使用iphoneSDK官方NSXMLParserDelegate做的简单xml解...