 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 26, 2004 7:04 pm Post subject: Re: HTTPS Post.... |
|
|
"Doug Johnson" <doug (AT) asknice (DOT) com> wrote
| Quote: | I want to use Indy to do the functional equivalent of this submit:
|
var
Values: TStringList;
MyData: String;
begin
Values := TStringList.Create;
try
Values['message'] :=
'==|PMIVer=1.1|FMVer=1.0|Vsv=8.0|Vid=compulink|Vpw=cA913Ck|Rid=9168514838|Rp
w=9168|Oid=00000123433361|Rt=BDS-VAL-MBR|Mid=370126101|Oph=9168514838|Mnm=ED
ISON,THOMAS|Gid=1202280100020001|Gnm=HONDA
OF AMERICA|Pnm=EDISON,
THOMAS|Pbd=19040101|Prd=?|Gdti=?|Mnm=?|Eld=?|Eid=?|Fid=?|Fnm=?||From=compuli
nk';
MyData :=
IdHTTP1.Post('https://pmi-acpt.eyefinity.com/servlet/PMIServlet', Values);
finally
Values.Free
end;
end;
Gambit
|
|
| Back to top |
|
 |
Doug Johnson Guest
|
Posted: Mon Apr 26, 2004 7:54 pm Post subject: Re: HTTPS Post.... |
|
|
Thanks for the response. I got an error on trying to compile, since
Values['message'] was expecting an integer, not a string.
By chance would this be what you meant to send me?
Values: TStringList;
MyData: String;
begin
MyData :=
'==|PMIVer=1.1|FMVer=1.0|Vsv=8.0|Vid=compulink|Vpw=cA913Ck|Rid=9168514838|Rpw=9168|Oid=00000123433361|Rt=BDS-VAL-MBR|Mid=370126101|Oph=9168514838';
MyData := MyData+ '|Mnm=EDISON,THOMAS|Gid=1202280100020001|Gnm=HONDA OF
AMERICA|Pnm=EDISON,
THOMAS|Pbd=19040101|Prd=?|Gdti=?|Mnm=?|Eld=?|Eid=?|Fid=?|Fnm=?|';
Values := TStringList.Create;
try
Values.Add('message='+MyData);
VSpHTTP.Post('https://pmi-acpt.eyefinity.com/servlet/PMIServlet',
Values);
finally
Values.Free
end;
If not, what needs to be in the TStringList for it to post like the
previous code?
If it is correct, then I am still getting an exception
EIDHTTPProtocolException "HTTP/1.1 400 Bad Request"
I notice that it mentions HTTP 1.1 and the documentation says that Post
always downsteps to HTTP 1.0.
I did attach the IDSSLIOHandler to TidHTTP.
Again, thanks for the help.
Doug
On Mon, 26 Apr 2004 12:04:14 -0700, Remy Lebeau (TeamB)
<gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote:
| Quote: |
"Doug Johnson" <doug (AT) asknice (DOT) com> wrote in message
news:opr62k4yzql2v16a (AT) localhost (DOT) ..
I want to use Indy to do the functional equivalent of this submit:
var
Values: TStringList;
MyData: String;
begin
Values := TStringList.Create;
try
Values['message'] :=
'==|PMIVer=1.1|FMVer=1.0|Vsv=8.0|Vid=compulink|Vpw=cA913Ck|Rid=9168514838|Rp
w=9168|Oid=00000123433361|Rt=BDS-VAL-MBR|Mid=370126101|Oph=9168514838|Mnm=ED
ISON,THOMAS|Gid=1202280100020001|Gnm=HONDA
OF AMERICA|Pnm=EDISON,
THOMAS|Pbd=19040101|Prd=?|Gdti=?|Mnm=?|Eld=?|Eid=?|Fid=?|Fnm=?||From=compuli
nk';
MyData :=
IdHTTP1.Post('https://pmi-acpt.eyefinity.com/servlet/PMIServlet',
Values);
finally
Values.Free
end;
end;
Gambit
|
|
|
| Back to top |
|
 |
Doug Johnson Guest
|
Posted: Mon Apr 26, 2004 8:00 pm Post subject: Re: HTTPS Post.... |
|
|
As an alternative, is there a way to capture a conversation between
Internet Explorer and a server as I run the working script, then duplicate
that conversation with the changes that I need...effectively to eavesdrop
in on my own conversation with the server (I have no control over the
server and pretty sparse documentation on their expectations, even though
I am supposed to write the interface).
Doug
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 26, 2004 9:32 pm Post subject: Re: HTTPS Post.... |
|
|
"Doug Johnson" <doug (AT) asknice (DOT) com> wrote
| Quote: | I got an error on trying to compile, since Values['message']
was expecting an integer, not a string.
|
Change this line:
Values['message'] := '...';
To this instead:
Values.Values['message'] := '...';
Gambit
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 26, 2004 9:33 pm Post subject: Re: HTTPS Post.... |
|
|
"Doug Johnson" <doug (AT) asknice (DOT) com> wrote
| Quote: | As an alternative, is there a way to capture a conversation
between Internet Explorer and a server as I run the working
script, then duplicate that conversation with the changes that I need...
|
Use a packet sniffer, such as Ethereal, http://www.ethereal.com
Gambit
|
|
| Back to top |
|
 |
Doug Johnson Guest
|
Posted: Mon Apr 26, 2004 10:10 pm Post subject: Re: HTTPS Post.... |
|
|
Thanks. It compiles now. It still gets a protocol exception, but with
the packet sniffer I should be able to see the differences. Does Indy URL
encode the text? If not, that could be my problem. In Delphi 5, there
was the FastNet TNMURL for encoding, but I am finding nothing in 7.
Is there something comparable, or do I need to install another component?
Doug
On Mon, 26 Apr 2004 14:32:52 -0700, Remy Lebeau (TeamB)
<gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote:
| Quote: |
"Doug Johnson" <doug (AT) asknice (DOT) com> wrote in message
news:opr62xltz5l2v16a (AT) localhost (DOT) ..
I got an error on trying to compile, since Values['message']
was expecting an integer, not a string.
Change this line:
Values['message'] := '...';
To this instead:
Values.Values['message'] := '...';
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 26, 2004 10:10 pm Post subject: Re: HTTPS Post.... |
|
|
"Doug Johnson" <doug (AT) asknice (DOT) com> wrote
| Quote: | Does Indy URL encode the text?
|
Yes, it does encode the post data, but only if hoForceEncodeParams is
enabled in the Options property.
| Quote: | In Delphi 5, there was the FastNet TNMURL for encoding,
but I am finding nothing in 7. Is there something comparable,
or do I need to install another component?
|
Indy has a TIdURI class that can do that.
Gambit
|
|
| Back to top |
|
 |
Doug Johnson Guest
|
Posted: Tue Apr 27, 2004 1:25 pm Post subject: Re: HTTPS Post.... |
|
|
Thank you for all your help....
I got it working thanks to your input. Bless you.
Doug
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|