Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Re: Post idhttp object with multiform

www.cryer.info
Managed Newsgroup Archive

Re: Post idhttp object with multiform

Subject:Re: Post idhttp object with multiform
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 20 Mar 2006 15:33:57

"Axel" <borland.public.delphi.internet.winsock@newsgroups.borland.com> wrote
in message news:441e78f8$1@newsgroups.borland.com...

> With the code i have post in the first mail, i try to do this. I
> use code like this in other application and it works.  I can
> simulate the service request use a htm file with the proper
> login and password in a browser and obviusly it works...
> (i try to get some test value to give you)

The code you showed earlier for submitting the form does not match the HTML
that you have shown now.  Your code should be like the following instead:

    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

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive