Created
August 24, 2009 17:42
-
-
Save kyanny/174003 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
int main(int argc, const char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSURL *url = [NSURL URLWithString:@"http://clip.livedoor.com/"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
NSURLResponse *response; | |
NSError *error; | |
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; | |
printf("%d\n", [data length]); | |
//printf("%s\n", [data bytes]); | |
[pool release]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment