Board index » delphi » 404 error with IdHTTP

404 error with IdHTTP


2003-08-14 02:39:18 PM
delphi198
I've posted this in atozed.indy.general but this NG seems less frequently
visited ;-)
I get an 404 error when trying to .Get() or .Head() this URL:
www.gm.fh-koeln.de/~faeskorn/diplom/duman/Dip.html
The funny thing is that IE shows this page! What is the difference between
IE and Indy's IdHTTP.Get() or .Head()?
This "feature" applies to some more URL's I want to check for validity.
However if IE says this URL exists and my program (Indy) says no, which of
them says the truth?
I assume that the error code will be delivered by the installed internet
server,
however why does IE not care about this and return an obviously correct
page?
Using UrlChecker Demo:
www.gm.fh-koeln.de/~faeskorn/diplom/ is valid or better does not
produce an 404 error
www.gm.fh-koeln.de/~faeskorn/diplom/diplom_1997.htm is invalid
etc..
It seems that all documents beyond
www.gm.fh-koeln.de/~faeskorn/diplom/ are declared as invalid. That's
almost not possible, isn't it?
cu,
Michael
 
 

Re:404 error with IdHTTP

On Thu, 14 Aug 2003 08:39:18 +0200, Michael Fritz writes:
Quote
It seems that all documents beyond
www.gm.fh-koeln.de/~faeskorn/diplom/ are declared as invalid. That's
almost not possible, isn't it?
Just a note - its not a user-agent problem. I tried wget and made it
appear as a lot of different user agents not representing a browser, and
it was downloaded correctly.
johannes
 

Re:404 error with IdHTTP

On Thu, 14 Aug 2003 11:26:16 +0200, Michael Fritz writes:
Quote
thanks for reply! wget is a unix/linux tool?
Yes, but it is available for windows as well. I do use Linux though :)
Quote
This means that IdHttp interprets something wrong, doesn't it?
Lets see the headers ;)
The server sends the following if I ask with wget (wget user agent):
HTTP/1.1 200 OK
Date: Thu, 14 Aug 2003 10:07:05 GMT
Server: IBM_HTTP_Server/1.3.12.2 Apache/1.3.12 (Unix)
Last-Modified: Mon, 27 Aug 2001 08:56:40 GMT
ETag: "217c03-5adde-3b8a0b48"
Accept-Ranges: bytes
Content-Length: 372190
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
I don't know what should be causing Indy to interpret this as 404 :->
It is pretty obvious a 200 reply :) And the server sends this no matter
what I use for the User-Agent.
johannes
 

Re:404 error with IdHTTP

Quote
The server sends the following if I ask with wget (wget user agent):

HTTP/1.1 200 OK
Date: Thu, 14 Aug 2003 10:07:05 GMT
Server: IBM_HTTP_Server/1.3.12.2 Apache/1.3.12 (Unix)
Last-Modified: Mon, 27 Aug 2001 08:56:40 GMT
ETag: "217c03-5adde-3b8a0b48"
Accept-Ranges: bytes
Content-Length: 372190
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

I don't know what should be causing Indy to interpret this as 404 :->
It is pretty obvious a 200 reply :) And the server sends this no matter
what I use for the User-Agent.
Hmmm, I remember I have seen this before when debugging through IdHTTP. But
when stepping forward a 404 error occured as well. I will have to look a
little bit closer now.
Did you use www.gm.fh-koeln.de/~faeskorn/diplom/ for testing (that
returns OK) or www.gm.fh-koeln.de/~faeskorn/diplom/duman/Dip.html
which causes a 404?
cu,
Michael
 

Re:404 error with IdHTTP

On Thu, 14 Aug 2003 12:26:19 +0200, Michael Fritz writes:
Quote
Did you use www.gm.fh-koeln.de/~faeskorn/diplom/ for testing (that
returns OK) or www.gm.fh-koeln.de/~faeskorn/diplom/duman/Dip.html
which causes a 404?
The latter.
johannes
 

Re:404 error with IdHTTP

Johannes Berg writes:
Quote
HTTP/1.1 200 OK

I don't know what should be causing Indy to interpret this as 404
:->It is pretty obvious a 200 reply :) And the server sends this
no matter what I use for the User-Agent.
Appears so... When I tested this (didn't feel like debugging, but
wanted to test if I had the same outcome) I received a "Bad request
400" error... Strange :-p
--
Markku Uttula
 

Re:404 error with IdHTTP

| There isn't any. They both have to conform to the same RFCs for the
| HTTP protocol. A 404 error is sent by the server, not the browser.
| So for whatever reason, the server is deciding on its end to not
| accept your request. Which version of Indy are you using? What are
| your exact settings for the TIdHTTP? What does your exact request
| look like?
Remy,
I'm using Delphi 7 with Indy 9.00.10. The program I am using is URLChecker by
Don Siders - a demo program for Indy IdHTTP and IdFTP and validation of
URLs.
I've just modified the code to use IdHttp.Get instead of IdHttp.Head
and included some proxy support (name, password, server and port -
BasicAuthentication is set to true). I can send you the modified source
if desired.
Hoewever I have tested the program now without any "disturbing" proxy and
the English version of Delphi 7 (before the German release) the result is the
same: 404 for the URL:
www.gm.fh-koeln.de/~faeskorn/diplom/duman/Dip.html
Clueless...
--
cu,
Michael
XanaNews version 1.15.3.2
 

Re:404 error with IdHTTP

"Michael Fritz" <XXXX@XXXXX.COM>writes
Quote
I'm using Delphi 7 with Indy 9.00.10.
Try upgrading Indy. The current version is 9.00.14 and there is a newer
shapshot version in the version control.
Quote
The program I am using is URLChecker by Don Siders
That doesn't tell me anything. I am not familiar with that app, thus my
previous questions and request for actual code.
Gambit
 

Re:404 error with IdHTTP

| Try upgrading Indy. The current version is 9.00.14 and there is a
| newer shapshot version in the version control.
Using Indy 9.00.14 did not solve this!
--
cu,
Michael
XanaNews version 1.15.3.2
 

Re:404 error with IdHTTP

"Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>schreef in bericht
Quote

"Michael Fritz" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...

>I'm using Delphi 7 with Indy 9.00.10.

Try upgrading Indy. The current version is 9.00.14 and there is a newer
shapshot version in the version control.
[snip]
Hi Remy,
I'm also using 9.00.10 and i can get the documents fine, so the version of
Indy is not the problem!
(I'm aware that in 9.00.14 some things are fixed, but atm. some new and very
{*word*193} problems where introduced with that version too, .10 works better for
me).
In the atozedsoftware.indy.general newsgroup there is also a thread for this
same issue.
I've been digging into this and have posted several suggestions there.
Start of thread:
From: "Michael Fritz" <XXXX@XXXXX.COM>
Newsgroups: atozedsoftware.indy.general
Subject: 404 error with IdHTTP
Date: Wed, 13 Aug 2003 11:41:40 +0200
Message-ID: <XXXX@XXXXX.COM>
Path: reddi-web-dns
Seeing now that Michael can eliminate the proxy in between, then there's
nothing left but to assume that he either has some weird network
communication problem (unlikely) or a bug in the software he's using.
I've already suggested he go back to a bare bones test app with just a
form,idhttp and a button..
I don't have Don's demo URL checker so i don't know how up to date it is,
but if it is anything like the other demo's then it is an Indy 8 demo and it's
files should not be used as the basis of any software as it will give only
big trouble..
Regards,
Marco..