I trying get text data from internet with C++ but I couldn't find anything useful.
like python;
import urllib
data = urllib.urlopen("examplesite.com/data.txt").read()
I trying get text data from internet with C++ but I couldn't find anything useful.
like python;
import urllib
data = urllib.urlopen("examplesite.com/data.txt").read()
Take a look at libcurl
. It is a C library, with C++ bindings.
The libcurl website includes a collection of examples in C, including one that copies a URL to a block of memory, getinmemory.c
For C++, the main page of the curlcpp
binding at https://github.com/JosephP91/curlcpp shows an example of downloading a URL to a file.