Delphi错误E2010不兼容的类型:'字符串'和'过程,无类型指针或无类型参数'

Sta*_*lin 2 delphi console indy

我使用了 TStringList 和类似的东西:

geo: TStringList;
response: TStringStream;
  begin
  http:=tidhttp.Create(nil);
  try
    { TODO -oUser -cConsole Main : Insert code here }
    geo:=TStringList.Create;
    response:=TStringStream.Create('');
    geo.Add('name=stas');
    geo.Add('pass=431');
    s:=http.Get('http://test.me');
    writeln(http.ResponseText);
    writeln(s);
    s:=http.Post('http://test.me',geo,response);
Run Code Online (Sandbox Code Playgroud)

但有些不对劲。例如,当我运行它时,它会发出警报并[[DCC Error] consoleHttp.dpr(29): E2010 Incompatible types: 'string' and 'procedure, untyped pointer or untyped parameter']显示s:=http.Post('http://test.me',geo,response). 我做错了什么?

RRU*_*RUZ 5

此错误意味着您向该方法传递了错误的参数TIdHTTP.post。这个方法有几个重载

function Post(AURL: string; ASource: TIdStrings): string; overload;
function Post(AURL: string; ASource: TIdStream): string; overload;
function Post(AURL: string; ASource: TIdMultiPartFormDataStream): string; overload;
procedure Post(AURL: string; ASource: TIdMultiPartFormDataStream; AResponseContent: TIdStream); overload;
procedure Post(AURL: string; ASource: TIdStrings; AResponseContent: TIdStream); overload;
procedure Post(AURL: string; ASource, AResponseContent: TIdStream); overload;
Run Code Online (Sandbox Code Playgroud)

但没有一个与您传递的参数匹配。