tags:

views:

184

answers:

2

I need to download files/read strings from a specified url in C++. I've done some research with this, cURL seems to be the most popular method. Also, I've used it before in PHP. The problem with cURL is that the lib is huge, and my file has to be small. I think you can do it with winsock, but I can't find any simple examples. If you have a simple winsock example, a light cURL/Something else, or anything that could get the job done. I would greatly appreciated. Also, I need this to work with native C++.

+1  A: 

you should try WinInet: this library is part of Windows operating system, and allows to download a resource identified by an URL, using either HTTP or FTP.

if you are using HTTP, you might find the InternetOpenUrl() function useful.

Adrien Plisson
+2  A: 

I can repeat me answer http://stackoverflow.com/questions/2682453/is-it-possible-to-handle-proxies-at-socket-level/2683338#2683338 (see also comments) about two important interfaces Windows Internet (WinINet) API and Windows HTTP Services (WinHTTP). An important restriction of WinINet is that WinINet should be not used in a service (only in GUI app.) because of possible dialogs.

Oleg
WinHTTP is exactly what I needed. Thank you.
Lienau