Hi friends,
Now i am using TIdHTTP to call a servlet which will accept and return XML data. The TIdHTTP works very well but i have question about it.
.the get methods
procedure Get(AURL: string; const AResponseContent: TStream); overload;
function Get(AURL: string): string; overload;
Parameters
AURL: string
The resource to be retrieved.
const AResponseContent: TStream
Destination for the data retrieved.
the get(AURL:string) works very well and i can get the XML data from the servlet.However if i use get(AURL:string; const AResponseContent:TStream) as below,i donot understand how to use the second parameter.
....
var
ms : TMemoryStream;
begin
ms := TMemoryStream.create;
try IdHTTP1.get(' memo1.Lines.loadFromStream(ms); <= get nothing
finally
ms.free;
end;
end;
the memo1 will not have any data . However the following code works very well:
...
try
memo1.Text := IdHTTP1.get('except
raise;
end
.the put methods
procedure Post(URL: string; const Source: TStrings; const AResponseContent: TStream); overload;
Parameters
URL: string
Location of the host or CGI application.
const Source: TStrings
Object containing the request data.
const AResponseContent: TStream
Destination for response data.
I still cannot understand how to use AResponseContent parameter to get the return data.
...
var
ms : TMemoryStream;
begin
ms := TMemoryStream.create;
try
IdHTTP1.put(' memo2.lines.loadFromStream(ms); <= get nothing
finally
free;
end;
end;
Any suggestion is appreciated ! ipo_z@cmmail.com
garbage in,garbage out
Now i am using TIdHTTP to call a servlet which will accept and return XML data. The TIdHTTP works very well but i have question about it.
.the get methods
procedure Get(AURL: string; const AResponseContent: TStream); overload;
function Get(AURL: string): string; overload;
Parameters
AURL: string
The resource to be retrieved.
const AResponseContent: TStream
Destination for the data retrieved.
the get(AURL:string) works very well and i can get the XML data from the servlet.However if i use get(AURL:string; const AResponseContent:TStream) as below,i donot understand how to use the second parameter.
....
var
ms : TMemoryStream;
begin
ms := TMemoryStream.create;
try IdHTTP1.get(' memo1.Lines.loadFromStream(ms); <= get nothing
finally
ms.free;
end;
end;
the memo1 will not have any data . However the following code works very well:
...
try
memo1.Text := IdHTTP1.get('except
raise;
end
.the put methods
procedure Post(URL: string; const Source: TStrings; const AResponseContent: TStream); overload;
Parameters
URL: string
Location of the host or CGI application.
const Source: TStrings
Object containing the request data.
const AResponseContent: TStream
Destination for response data.
I still cannot understand how to use AResponseContent parameter to get the return data.
...
var
ms : TMemoryStream;
begin
ms := TMemoryStream.create;
try
IdHTTP1.put(' memo2.lines.loadFromStream(ms); <= get nothing
finally
free;
end;
end;
Any suggestion is appreciated ! ipo_z@cmmail.com
garbage in,garbage out