I have a web page whose content I’d like to download into a wxString.
For example, let’s say that page is this:
http://www.example.com/mypage.html
And wxString would contain HTML source. In some other languages, say PHP
for example, I would write something like this:
$html = file_get_contents('http://www.example.com/mypage.html');
I guess it is not a one-liner in wxWidgets, and I have peeked into wxHTTP class, but I wonder if there is some simple wrapper class that does the job with minimal code?
If you are running on windows you could use the Microsoft WinHTTP library. However, having a quick look at the wxHTTP documentation, WinHTTP probably isn’t any easier.
Have a look at this straightforward wxHTTP sample code. It is doing exactly what you are after.