Re: IdHttp.Post not working with stringlist ?

Giganews Newsgroups
Subject: Re: IdHttp.Post not working with stringlist ?
Posted by:  Tommi Prami (tommi.nospam.prami@poista.ecomond.com)
Date: Tue, 16 Oct 2007

Try

Responce := IdHTTP.Post(URL, XMlFile);

if there is TStrings acceptable overloaded version should work now, you
are passing string, not TStrings...

-TP-

Marcel Horsthuis wrote:
> Hello,
>
> I try to send an XML file with the idHTTP.Post method as follows.
>
>  if OpenDialog1.Execute then begin
>    XMLFile := TStringList.Create;
>    try
>      XMlFile.LoadFromFile(OPenDialog1.FileName);
>      Responce := IdHTTP.Post(URL, XMlFile.Text);
>
>      ShowMessage(Responce);
>    finally
>      XMLFile.Free;
>    end;
>  end;
>
> When I compile the program I get the error :
>
> "E2250 There is no overloaded version of 'Post' that can be called with
> these arguments"
>
> Even if I change the TStringList to TStrings I get the same error.
> Can anyboy help?
>
> I'm using Delphi 2007 (Update 2) and Indy 10.
>
> Thanks in advance.
>
> Marcel

Replies

In response to

IdHttp.Post not working with stringlist ? posted by Marcel Horsthuis on Tue, 16 Oct 2007