• Welcome to Valhalla Legends Archive.
 

Win32 API and HTTP

Started by Banana fanna fo fanna, June 12, 2007, 09:25 AM

Previous topic - Next topic

Banana fanna fo fanna

Easy way to request a URL and get the HTTP response with the native Win32/POSIX API? Something like:


HTTPResponse response;
char buffer[255];
FetchURL("http://www.blah.com/dosomething.php?x=y", &response, &buffer, 255);
printf("Response body was of length %d and was: %s\n", response.content_length, buffer);

Skywing

WinHttp: WinHttpOpen, WinHttpOpenRequest, WinHttpSendRequest, WinHttpReadData.

Or, alternatively (though WinHttp is considered the preferred choice on modern platforms), there still exists WinInet: InternetOpen, InternetOpenUrl, InternetReadFile (or the Http* APIs instead, or InternetDownloadUrlToFile).

Banana fanna fo fanna