Article View: borland.public.cppbuilder.internet.web
Article #209Re: Logging in with TIdHTTP
From: Remy Lebeau (TeamB)
Date: Wed, 04 Jul 2007 02:19
Date: Wed, 04 Jul 2007 02:19
63 lines
3402 bytes
3402 bytes
"Tom Byars" <tam118118@hotmail.com> wrote in message
news:468ac25e$1@newsgroups.borland.com...
>
Login->Values["PARGS"]="http%253A%252F%252Fwww.racingpost.co.uk%252Fne
ws%252Fhome.sd";
That is wrong. You are sending a string whose characters have already
been URL-encoded twice (which in itself is a problem as they should
not be encoded twice). In other words, characters that the original
encoder thought was not considered safe by the URI specification (in
this case, the encoded characters were safe and did not need encoding)
were converted to their "%HH" equivilents, where "HH" is the 2-digit
hex value for the character (the ":" character is "%3A", and the "/"
character is "%2F"). Then the encoded string was encoded again,
converting the "%" characters themselves into "%25".
Post() is going to take that double-encoded string and encode it a
third time (which it is supposed to). Thus, the final URL that is
transmitted to the server will look like this:
"http%25253A%25252F%25252Fwww.racingpost.co.uk%25252Fnews%25252Fhome.s
d"
When the server receives that, it is going to decode it back to the
value you originally stored in the TStringList:
"http%253A%252F%252Fwww.racingpost.co.uk%252Fnews%252Fhome.sd"
Which is not a valid URL for the server to act on. The URL that you
store in the TStringList should not be initially encoded at all. Did
you try specifying the original unencoded URL like I showed you
earlier?
Login->Values["PARGS"] =
"http://www.racingpost.co.uk/news/home.sd";
TIdHTTP will not encode that at all as all of the characters are safe.
Then there is nothing for the server to decode, and it will then have
the original URL available to use.
> Incidentally, I had to set Betting->InterceptEnabled=false as the
program
> hung when the Betting->Put line was executed.
The website expects you to post to an HTTPS URL. If you disable the
Intercept, then you won't be able to access any HTTPS resources at
all.
> I'm thinking that then makes the InterceptSSL component redundant
> which in turn makes me think there are properties in the component
I've
> not set right (although I don't know what the properties mean and
indy
> help is no help).
TIdHTTP does not directly implement any SSL handling. You must use an
SSL-enabled Intercept for that.
Gambit
Technical Details
Message-ID:
<468b039a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46878587@newsgroups.borland.com> <4689349a@newsgroups.borland.com> <468a2b26$1@newsgroups.borland.com> <468a7aa6@newsgroups.borland.com> <468ac25e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,e38d4989d40bbffa X-Google-Attributes: gidfeeec,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <46878587@newsgroups.borland.com> <4689349a@newsgroups.borland.com> <468a2b26$1@newsgroups.borland.com> <468a7aa6@newsgroups.borland.com> <468ac25e$1@newsgroups.borland.com> Subject: Re: Logging in with TIdHTTP Date: Tue, 3 Jul 2007 19:19:04 -0700 Lines: 65 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 75.82.252.126 Message-ID: <468b039a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1183515546 75.82.252.126 (3 Jul 2007 19:19:06 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail