lab4 загрузка файла через curl
Этот коммит содержится в:
@@ -30,7 +30,14 @@ Input input_data(istream& in,bool prompt)
|
|||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (argc > 1) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
curl_global_init(CURL_GLOBAL_ALL);
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user