From e48cc10a8f086853fac47fa638e16a6236a8558f Mon Sep 17 00:00:00 2001 From: Danila Date: Sat, 3 Jun 2023 15:36:15 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=20curl=20example=20=D0=B2=20=D0=BD=D0=B0=D1=87=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/project/main.cpp b/project/main.cpp index 36e141f..ed8493b 100644 --- a/project/main.cpp +++ b/project/main.cpp @@ -38,8 +38,16 @@ input_data(istream& in, bool promt) int main(int argc, char* argv[]) { - if (argc > 1){ - cout << argc << "argv[0] = " << argv << endl; + if (argc > 1) + { + 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); + } return 0; } curl_global_init(CURL_GLOBAL_ALL);