How to download an URL (cross-platform)

S

Simon

Is there a simple, cross-platform method of downloading an URL. I can
in Python by typing:

data = urllib2.urlopen('www.example.com/example file.html').read()

and I was wondering if there was an easy way to do that in C or C++
(without using some Microsoft/Visual Studio or Mac-only method). If you
know of a way, please reply; thanks in advance.

Simon
 
I

Ivan Vecerina

: Is there a simple, cross-platform method of downloading an URL. I can
: in Python by typing:
:
: data = urllib2.urlopen('www.example.com/example file.html').read()
:
: and I was wondering if there was an easy way to do that in C or C++
: (without using some Microsoft/Visual Studio or Mac-only method). If you
: know of a way, please reply; thanks in advance.

Of course the standard C++ library provides nothing for that, but
cross-platform libraries exist.
A popular choice seems to be libcurl: http://curl.haxx.se/libcurl/

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top