CCHTTPRequest 1.0.2

CCHTTPRequest 1.0.2

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2015年10月

Cathy Shive维护。



为iOS的无废话网络。

安装

将CCHTTPRequest.h和CCHTTPRequest.m复制到您的Xcode项目中。

如果您正在使用CocoaPods,请将以下行添加到您的Podfile中

pod 'CCHTTPRequest'

文档

步骤1:初始化CCHTTPRequest对象。

步骤2:设置完成和失败块。

步骤3:开始请求。

示例

// Step 1. Create the request
CCHTTPRequest *aRequest = [[CCHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://graph.facebook.com/zowieso"]];

// Step 2. Set the completion and failure blocks
[aRequest setCompletionBlock:^(NSURLResponse *theResponse, NSData *theData) {
    NSError *anError;
   id aResponseJSON = [NSJSONSerialization JSONObjectWithData:theData options:NSJSONReadingAllowFragments error:&anError];
   if (!anError) {
      NSLog(@"%@", aResponseJSON);
   }
} failureBlock:^(NSError *theError) {
   NSLog(@"Request failed with error: %@", theError);
}];

// Step 3. Begin the request
[aRequest begin];

作者

Cathy Shive,[email protected]

许可证

CCHTTPRequest可使用MIT许可证获取。有关更多信息,请参阅LICENSE文件。