From cc3edb07b1895510250a494230de60615be4849c Mon Sep 17 00:00:00 2001 From: IvanonVG Date: Sat, 24 May 2025 23:38:14 +0300 Subject: [PATCH] code: curl_easy_init() --- main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 9043696..acae854 100644 --- a/main.cpp +++ b/main.cpp @@ -39,8 +39,12 @@ Input input_data(istream& in, bool prompt) { int main(int argc, char* argv[]) { curl_global_init(CURL_GLOBAL_ALL); if (argc > 1) { - for (size_t i = 0; i < argc; i++) { - cerr << "argv [" << i << "] = " << argv[i]; + 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); } } auto in = input_data(cin, true);