Re: Stuck with NSURL
Re: Stuck with NSURL
- Subject: Re: Stuck with NSURL
- From: Ben Hines <email@hidden>
- Date: Sun, 27 Jan 2002 07:48:12 -0800
You might look into doing a Watson Tool plugin if you are parsimg web pages.
It makes it soooo easy.
You could make a game server browser with watson easily.
http://www.karelia.com/watson/
-Ben
At 3:34 PM -0500 1/20/02, Mike Davis wrote:
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] initWithData: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.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
http://homepage.mac.com/bhines/