IOS HTTP 同步请求

NSURL* url = [NSURL URLWithString:urlString];

    NSURLRequest* request = [NSURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:10];

NSData* data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];

        NSString *aString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

你可能感兴趣的:(http)