ASIHTTPRequest异步请求

需要引入
libz.dylib
CfNetwork.framework
MobileCoreServices.framework
Security.framework
SystemConfiguration.framework

NSString *urlString = @"http://....";
    
NSURL *url = [NSURL URLWithString:urlString];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];


- (void)requestFinished:(ASIHTTPRequest *)request{
    NSString *html = [request responseString];
 }

- (void)requestFailed:(ASIHTTPRequest *)request
{
    //NSError *error = [request error];
}

你可能感兴趣的:(ASIHTTPRequest)