Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: Post idhttp object with multiform
| Subject: | Re: Post idhttp object with multiform |
| Posted by: | "Axel" (borland.public.delphi.internet.winso..@newsgroups.borland.com) |
| Date: | Tue, 21 Mar 2006 12:40:40 |
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ha scritto nel messaggio
news:441f3ba7$1@newsgroups.borland.com...
>
> "Axel" <borland.public.delphi.internet.winsock@newsgroups.borland.com>
> wrote
> in message news:441e78f8$1@newsgroups.borland.com...
>
the lines you added,
> FormData.AddFormField('INTERACTIVE', '1');
> FormData.AddFormField('CMDLOGIN', 'Logon');
are only for interactive authentication, with the browser.
I had tried the code up write yet...
With the html code i posted earlier, that have 3 fields, i get the
authentication (with the correct login and pwd)
I'm waiting for a answer about a test login-pwd
Thanks a lot
> procedure TWebSenderNuovo.OttieniToken;
> var
> FormData: TidMultiPartFormDataStream;
> ResponseStream: TMemoryStream;
> begin
> FormData := TIdMultiPartFormDataStream.Create;
> try
> ResponseStream := TMemoryStream.Create;
> try
> FormData.AddFormField('USRNAME', FUser);
> FormData.AddFormField('USRPWD', FPwd);
> FormData.AddFormField('PTLTOKENCTX', 'UPLOAD');
> FormData.AddFormField('INTERACTIVE', '1');
> FormData.AddFormField('CMDLOGIN', 'Logon');
> FHttp.Post('https://www.postel.it/PTLTOKEN/logon',
> FormData,
> ResponseStream);
> ResponseStream.Position := 0;
> ResponseStream.SaveToFile('c:\fresponse.asc');
> finally
> ResponseStream.Free;
> end;
> finally
> FormData.Free;
> end;
> end;
>
>> Is there a method to view the html code i post??
>
> Since you are posting with an HTTPS server, that is going to be difficult
> since the outgoing data is encrypted. Had you not been posting with an
> encrypted connection, you could use one of the TIdLog... components, or an
> external packet sniffer, to view the data that is transmitted over the
> socket.
>
>
> Gambit