NSURL / NSURLHandle loading problem
NSURL / NSURLHandle loading problem
- Subject: NSURL / NSURLHandle loading problem
- From: Ben Haller <email@hidden>
- Date: Mon, 19 May 2003 16:41:06 -0700
OK, I'm mystified. I'm just trying to load, in the foreground, the
data from a URL (at my website:
http://www.sticksoftware.com/index.html). The website is up, and IE
can fetch the URL with no problems. So my first-pass code was very
simple: make a URL from the string, call resourceDataUsingCache:NO.
That returned nil, as did resourceDataUsingCache:YES. Then I shifted
over to using NSURLHandle, to see if that would work any better, but
-loadInForeground returns nil (-status returns 0 and -failureReason
returns nil, so it's a mystery what the problem is -- it seems to be
ignoring my request that it load). So then I added all the
NSURLHandleClient methods and tried doing a background load. And
that's when things get really wacky. I put logs in my client methods,
and here's what I get:
2003-05-19 16:28:11.397 appname[27131] URLHandleResourceDidBeginLoading
2003-05-19 16:28:11.480 appname[27131]
resourceDidFailLoadingWithReason: HTTP request failed for URL
http://www.sticksoftware.com:80/index.html:Bad Request
Now, that port # of 80 is not in the string I passed to NSURL, nor is
it in the NSURL itself, as far as one can tell by doing an NSLog of the
URL. It appears to be getting added by NSURLHandle in the process of
actually doing the load. And *that* URL, with the port # included,
does not work in IE; it returns an error page. (Interesting that I
don't get the error page back as my URL data, but there must be an
error code included with the page that short-circuits NSURLHandle's
fetch or something).
Now, port 80 is the standard HTTP port, so I have no idea why
explicitly including that port number causes an error page; presumably
that port is used regardless. But I guess my web server has that
quirk, for whatever reason. I'm taking that up with my service
provider even as I type. I will not be surprised if this quirk cannot
be fixed on the server, though.
So my question is: is there a way to force NSURLHandle not to
explicitly include the port number? Or am I mistaken regarding what
the issue is here? Any assistance would be greatly appreciated; PLEASE
RESPOND DIRECTLY TO ME AS WELL AS TO THE LIST, as I don't have time
these days to keep up with the list all the time. Thanks!
Ben Haller
Stick Software
_______________________________________________
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.