Skip to content

Instantly share code, notes, and snippets.

@adnan360
Last active March 28, 2019 07:00
Show Gist options
  • Save adnan360/a5d4ef7a3182ac29b50bb971dc81d235 to your computer and use it in GitHub Desktop.
Save adnan360/a5d4ef7a3182ac29b50bb971dc81d235 to your computer and use it in GitHub Desktop.
Send post data and show response
uses
..., fphttpclient;
procedure TForm1.Button1Click(Sender: TObject);
begin
With TFPHttpClient.Create(Nil) do
try
// Sends post request and puts the response in a TMemo.
// Data is passed as fieldname=fieldvalue format.
Memo1.Text := FormPost('http://localhost/test/post.php','test1=test2');
finally
Free;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment