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

倖福魔咒の 提交于 2019-12-02 03:47:28

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.

MarceloXP

do this:

http.Post('http://test.me',geo,response);

instead of:

s:=http.Post('http://test.me',geo,response);

The only matching method is a procedure, but procedures don't return values. The error message is saying that you can't assign a procedure to a string.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!