Jump to content

Recommended Posts

Posted

Hello,

 

I need to send a form via Post to external URL.

When proccess be finished this URL send me a POST with results values and I need to access this values.

 

How can I do work in this scenario ?

 

Any sample ?

 

Regards

Posted

This can not be done with unigui. You need use Indy, or another http/sockets library

 

 

procedure TForm1.Button1Click(Sender: TObject);
var
 http: TIdHttp;
 params: TStrings;
 Response: string;
begin
 http := TIdHTTP.Create(Self);
 params := TStringList.Create;
 try
   params.Add('var1=value1');
   params.Add('var1=value2');
   Response := http.Post('http://dec.clubdelphi.com/temporales/pruebas-post.php', params);
   ShowMessage('Response: ' + Response);
 finally
   http.Free;
   params.Free;
 end;
end;

Posted

I am trying to form code via AddJS:

 

<form id=compra name=compra action="URLK" method=post>
<input type=hidden name=Merc value="TPV">
...
</form>

 

Then I try to call form submit:

 

function OnClick(sender, e)
{
 window.document.forms["compra"].submit();
}

 

 

But it does not work.

 

Regards

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...