Article View: borland.public.cppbuilder.internet.socket
Article #68Re: How to call php code from indy
From: Remy Lebeau (TeamB)
Date: Fri, 18 Apr 2008 03:53
Date: Fri, 18 Apr 2008 03:53
44 lines
2615 bytes
2615 bytes
"roladdon" <roladdon@PutMyServerHere.ca> wrote in message news:48080716$1@newsgroups.borland.com... > Sorry - I am new to packet sniffers. > I hope this will be O.K. Look at the request that works: GET /php-test/test.php HTTP/1.1 Accept: */* Accept-Language: en-ca UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648) Host: torontowindsurfingclub.ca Connection: Keep-Alive Now look at your request that fails: GET /php-test/test.php HTTP/1.1 Host: torontowindsurfingclub.ca Accept: text/html, */* Accept-Encoding: identity User-Agent: Mozilla/3.0 (compatible; Indy Library) There are two differences that could potentially cause one request to succeed but the other to fail - the User-Agent and Accept-Encoding header fields. Some servers filter on the User-Agent field so they can provide browser-specific content. Your server may be rejecting Indy as a User-Agent. Try changing the Request.UserAgent property to closer match what IE uses. If that does not work, then the Accept-Encoding header may also be a factor. The server may be wanting to compress every file, but your request is not allowing it to. However, you did not say which version of Indy you are actually using. Indy 9 and earlier do not support compressed HTTP replies. Indy 10 does, though. TIdHTTP has a Compressor property for that. Gambit
Technical Details
Message-ID:
<48082037$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.isoc.lu!newsgroups.borland.com!not-for-mailReferences:
<48075eba@newsgroups.borland.com> <48077e81@newsgroups.borland.com> <480785b3@newsgroups.borland.com> <48079f68$1@newsgroups.borland.com> <4807a09d@newsgroups.borland.com> <4807ba81$1@newsgroups.borland.com> <4807d7ed$1@newsgroups.borland.com> <4807ecb9$1@newsgroups.borland.com> <48080716$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <48075eba@newsgroups.borland.com> <48077e81@newsgroups.borland.com> <480785b3@newsgroups.borland.com> <48079f68$1@newsgroups.borland.com> <4807a09d@newsgroups.borland.com> <4807ba81$1@newsgroups.borland.com> <4807d7ed$1@newsgroups.borland.com> <4807ecb9$1@newsgroups.borland.com> <48080716$1@newsgroups.borland.com> Subject: Re: How to call php code from indy Date: Thu, 17 Apr 2008 20:53:24 -0700 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 76.89.173.41 Message-ID: <48082037$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1208492087 76.89.173.41 (17 Apr 2008 21:14:47 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.isoc.lu!newsgroups.borland.com!not-for-mail