lab4 загрузка файла через curl

Этот коммит содержится в:
2024-05-11 21:10:19 +03:00
родитель a5671d8ea7
Коммит 246858e696

Просмотреть файл

@@ -30,7 +30,14 @@ Input input_data(istream& in,bool prompt)
int main(int argc, char* argv[])
{
if (argc > 1) {
for (int i = 0; i < argc; i++) cout << "argv[" << i << "] = " << argv[i] << endl;
CURL* curl = curl_easy_init();
if (curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
cout << res <<endl ;
}
return 0;
}
curl_global_init(CURL_GLOBAL_ALL);