Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Error E2010 Incompatible types: 'string' and 'procedure, untyped pointer or untyped parameter'

I used TStringList and something that looks like:

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);

but something is wrong. For example when I run it it's alerting with the error [[DCC Error] consoleHttp.dpr(29): E2010 Incompatible types: 'string' and 'procedure, untyped pointer or untyped parameter'] in s:=http.Post('http://test.me',geo,response). What did I do wrong?

like image 600
Stasonix Niculin Avatar asked Feb 11 '26 09:02

Stasonix Niculin


1 Answers

This error means which you are passing wrong parameters to the method TIdHTTP.post. this method has several overloads

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;

but none match with the parameters which you are passing.

like image 129
RRUZ Avatar answered Feb 13 '26 13:02

RRUZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!