更新时间:2023-02-22 23:00:26
使用Indy。把你的参数放在一个StringList(name = value)中,只需用URL和StringList调用Post。
Using Indy. Put your parameters in a StringList (name=value) and simply call Post with the URL and StringList.
function PostExample: string;
var
lHTTP: TIdHTTP;
lParamList: TStringList;
begin
lParamList := TStringList.Create;
lParamList.Add('id=1');
lHTTP := TIdHTTP.Create(nil);
try
Result := lHTTP.Post('http://blahblahblah...', lParamList);
finally
lHTTP.Free;
lParamList.Free;
end;
end;