[fpc-pascal] XML from a site
Chris Moody
inquiry at greensnakedesign.com
Thu Jul 16 09:23:54 CEST 2015
Hi all,
Currently working on an app which needs to be able to read an XML from a
website. Looking at the page at http://wiki.freepascal.org/XML_Tutorial
it appears there is no way to get XML directly from a URL.
Do I need to pull the page down via :
function GetWebPageContent(const Url: string): String;
var fs: TStringList; HTTP: THTTPSend;
begin
fs := TStringList.Create;
HTTP := THTTPSend.Create;
try
HTTP.HTTPMethod('GET', Url);
fs.LoadFromStream(Http.Document);
Result := fs.Text;
finally
fs.Free;
http.Free;
end;
end;
Or is there a way to pass an URL to ReadXMLFile?
Thanks in advance!
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150716/e75fb500/attachment.html>
More information about the fpc-pascal
mailing list