1

我在 ASIHTTPRequest 中的代码是:

 NSURL *url = [NSURL URLWithString:@"http://avicenna-apps.com/harleyeventget.php"];
ASIHTTPRequest *_Request = [ASIHTTPRequest requestWithURL:url];
__weak ASIHTTPRequest * Request=_Request;
[Request setCompletionBlock:^{
    NSData *Data = [Request responseData];
];
[Request setFailedBlock:^{
    NSError *error = [Request error];
      NSlog(@"Error IS %@,error");
}];
[Request startAsynchronous];

我如何在 AFNetwork 中编写它?

4

1 回答 1

0

里面AFHttpClient

  (void)getPath:(NSString *)path
     parameters:(NSDictionary *)parameters
        success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
        failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure

这里是 AFNetworking 的官方网站,点击

于 2013-01-10T14:03:42.450 回答