Different result with NSURLRequest then with curl (or browser)
Different result with NSURLRequest then with curl (or browser)
- Subject: Different result with NSURLRequest then with curl (or browser)
- From: Tobias Tom <email@hidden>
- Date: Fri, 21 Nov 2008 23:32:30 +0100
Hey everyone,
I'm trying to access the API of delicious. You can access a JSON list
just by using the URL http://feeds.delicious.com/v2/json/.
So I tried to access that result from within cocoa code. Here's my try:
NSURL *url = [NSURL URLWithString:@"http://feeds.delicious.com/v2/
json/"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url
cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:30];
NSData *urlData;
NSURLResponse *response;
NSError *error;
urlData = [NSURLConnection sendSynchronousRequest:urlRequest
returningResponse:&response error:&error];
value = [[NSString alloc] initWithData:urlData
encoding:NSUTF8StringEncoding];
NSLog(@"%@", value);
My problem is now that value is a complete different result then from
curl or a browser window. My result is just the following:
<!-- fe02.feeds.del.ac4.yahoo.net uncompressed/chunked Fri Nov 21
14:19:31 PST 2008 -->
Maybe anyone can help me to find the problem. Maybe it is related to
chunked transfer or something like that, but I did not find any
information about that inside the apple docs.
Thank you very much for your help
Tobias
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden