Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created August 24, 2009 17:42
Show Gist options
  • Save kyanny/174003 to your computer and use it in GitHub Desktop.
Save kyanny/174003 to your computer and use it in GitHub Desktop.
#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