determining 404

Jim jimc at ace-pb.com
Mon Apr 26 16:59:47 EDT 2004


On Apr 26, 2004, at 2:40 PM, Dave Cragg wrote:

> I'm not sure if this is exactly what you want, but if you check the 
> result after an http url call (get, post, etc.) it will contain the 
> word "error" followed by the status code and the status message 
> returned by the server (unless the call succeeded in which case the 
> result will return empty.) Typically, for a 404 status code, the 
> result will contain "error 404 File not found". You can't rely on the 
> consistency of the message (it can vary by server, script, etc. and is 
> intended to be human readable), but the status code will always be 
> word 2 of the result.
>

A server can be set up to deliver a custom page (rather than generic 
html reply) for 404. I did a quick test on a WebStar server, having set 
up a custom page for errors. It did, indeed, report a 404, but it said 
"OK", too...

HTTP/1.1 404 OK

So, you'll want to check out word 2 of libURLLastRHHeaders() to see if 
it's truly a 404.

Actually, even without a custom error page, it still reports the same. 
Hmmm.

Jim



More information about the use-livecode mailing list