How to request and parse a xml file?
I need to download a xml file from another side on a regular base, parsing its data when download is finished. I think it has to be done with help of a WFileResource, but im lost using it. Can anyone please give an example on how to do it?
RE: How to request and parse a xml file? - Added by Koen Deforche over 11 years ago
There is no support in Wt to open a connection to another server (i.e. to act as a HTTP client).
You should consider another library for this.
One possible way is to use Boost.Asio (which is already being used by Wt in the httpd).
See for example src/Wt/Http/Client.C implementation (doGet() function) on how to use this to do
a HTTP request, or start from one of the Boost.Asio examples, which also contain HTTP client implementations.
RE: How to request and parse a xml file? - Added by Wim Dumon over 11 years ago
Or you could use e.g. curl, which is already a well-tested http client implementation.