Stuck with NSURL
Stuck with NSURL
- Subject: Stuck with NSURL
- From: Mike Davis <email@hidden>
- Date: Sun, 20 Jan 2002 15:34:25 -0500
Take a look at this URL in IE or OmniWeb:
http://www.gameaholic.com/servers/qspy-quake2
Now take a look at it with:
NSURL *theURL = [NSURL
URLWithString:@"
http://www.gameaholic.com/servers/qspy-quake2"];
NSData *theData;
NSString *theString;
if( ( theData = [theURL resourceDataUsingCache:NO] ) != nil ) {
theString = [[[NSString alloc] initWith
Data:theData
encoding:[NSString defaultCStringEncoding]] autorelease];
NSLog( theString );
}
I don't get what I expected.
So... I took a look at it with telnet:
telnet www.gameaholic.com 80
GET /servers/qspy-quake2 HTTP/1.0
Remember the blank line.
I notice that the MIME type is html, which it really isn't. IE and
OmniWeb seem happy about it though.
Any ideas how I can fix this or am I going to have to resort to socket
code?
Mike.