mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-08 11:56:09 +02:00
29 lines
449 B
ObjectPascal
29 lines
449 B
ObjectPascal
program httppostfile;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
uses
|
|
SysUtils, Classes, fphttpclient;
|
|
|
|
Var
|
|
F : TFileStream;
|
|
Vars : TStrings;
|
|
i : integer;
|
|
begin
|
|
With TFPHTTPClient.Create(Nil) do
|
|
begin
|
|
F:=TFileStream.Create('response.html',fmCreate);
|
|
try
|
|
Vars:=TstringList.Create;
|
|
try
|
|
FileFormPost(ParamStr(1),'myfile',paramstr(2),f);
|
|
finally
|
|
Vars.Free;
|
|
end;
|
|
finally
|
|
F.Free;
|
|
end;
|
|
end;
|
|
end.
|
|
|