├── .github
└── FUNDING.yml
├── .gitignore
├── CMake
└── curlcppConfig.cmake.in
├── CMakeLists.txt
├── CMakeScripts
└── JoinPaths.cmake
├── LICENSE
├── README.md
├── include
├── cookie.h
├── cookie_date.h
├── cookie_datetime.h
├── cookie_time.h
├── curl_config.h
├── curl_cookie.h
├── curl_easy.h
├── curl_easy_info.h
├── curl_exception.h
├── curl_form.h
├── curl_global.h
├── curl_header.h
├── curl_info.h
├── curl_interface.h
├── curl_ios.h
├── curl_multi.h
├── curl_option.h
├── curl_pair.h
├── curl_receiver.h
├── curl_sender.h
├── curl_share.h
└── curl_utility.h
├── src
├── CMakeLists.txt
├── cookie.cpp
├── cookie_date.cpp
├── cookie_datetime.cpp
├── cookie_time.cpp
├── curl_cookie.cpp
├── curl_easy.cpp
├── curl_exception.cpp
├── curl_form.cpp
├── curl_global.cpp
├── curl_header.cpp
├── curl_info.cpp
├── curl_multi.cpp
├── curl_share.cpp
└── curlcpp.pc.in
└── test
├── CMakeLists.txt
├── cookie.cpp
├── custom_request.cpp
├── easy.cpp
├── easy_info.cpp
├── header.cpp
├── multi.cpp
├── output_variable.cpp
└── recv_header.cpp
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | custom: https://www.bitcoinqrcodemaker.com/pay/?type=2&style=bitcoin&color=1&border=4&address=bc1qej7q0wuh3f944v9yx3s7a2ltn8aj6wyrddyc62
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | build/
3 | blocks/
4 | bii/build
5 | bii/cmake
6 | bii/deps
7 | bii/lib
8 | bii/.hive.db
9 | build.log
10 | .idea/
11 | cmake-build-debug/
12 | cmake-build-debug-visual-studio/
13 | .vscode
14 | install
15 | .DS_Store
16 | *.out
17 | *.swp
18 |
--------------------------------------------------------------------------------
/CMake/curlcppConfig.cmake.in:
--------------------------------------------------------------------------------
1 | # curlcppConfig.cmake - Configuration file for external projects.
2 | @PACKAGE_INIT@
3 | include(CMakeFindDependencyMacro)
4 | find_dependency(CURL CONFIG REQUIRED)
5 |
6 | include("${CMAKE_CURRENT_LIST_DIR}/curlcppTargets.cmake")
7 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.10...3.15)
2 |
3 | # Setting up project
4 | project(curlcpp
5 | VERSION 3.1
6 | DESCRIPTION "An object oriented C++ wrapper for CURL (libcurl)"
7 | HOMEPAGE_URL "https://github.com/JosephP91/curlcpp/"
8 | LANGUAGES CXX)
9 |
10 | # For the pkg-config file. Please read https://github.com/jtojnar/cmake-snips
11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeScripts")
12 | include(JoinPaths)
13 |
14 | include(GNUInstallDirs)
15 |
16 | option(BUILD_TEST "Build Tests" OFF)
17 |
18 | # if using an older VERSION of curl ocsp stapling can be disabled
19 | set(CURL_MIN_VERSION "7.34.0")
20 |
21 | set(DEFAULT_BUILD_TYPE "Release")
22 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
23 | message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
24 | set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
25 | # Set the possible values of build type for cmake-gui
26 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
27 | endif()
28 |
29 | include(CheckIPOSupported)
30 | check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT ERROR)
31 |
32 | if(IPO_SUPPORTED)
33 | message(STATUS "IPO / LTO supported, will enable for targets in release build type")
34 | else()
35 | message(STATUS "IPO / LTO not supported: <${ERROR}>, will not enable")
36 | endif()
37 |
38 | option(CURLCPP_USE_PKGCONFIG "Use pkg-config to find libcurl. When off, find_package() will be used" OFF)
39 |
40 | # Set up source directories
41 | add_subdirectory(src)
42 |
43 | # Set up test directory.
44 | if(BUILD_TEST)
45 | add_subdirectory(test)
46 | endif()
47 |
48 | # Install
49 | install(EXPORT curlcppTargets NAMESPACE curlcpp:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/curlcpp)
50 | include(CMakePackageConfigHelpers)
51 | configure_package_config_file(CMake/curlcppConfig.cmake.in "${PROJECT_BINARY_DIR}/curlcppConfig.cmake" INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/curlcpp")
52 | install(FILES ${PROJECT_BINARY_DIR}/curlcppConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/curlcpp)
53 |
54 | join_paths(libdir_for_pc_file "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
55 | join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
56 | configure_file("${PROJECT_SOURCE_DIR}/src/curlcpp.pc.in" "${PROJECT_BINARY_DIR}/src/curlcpp.pc" @ONLY)
57 | install(FILES "${PROJECT_BINARY_DIR}/src/curlcpp.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
58 |
--------------------------------------------------------------------------------
/CMakeScripts/JoinPaths.cmake:
--------------------------------------------------------------------------------
1 | # This module provides function for joining paths
2 | # known from most languages
3 | #
4 | # SPDX-License-Identifier: (MIT OR CC0-1.0)
5 | # Copyright 2020 Jan Tojnar
6 | # https://github.com/jtojnar/cmake-snips
7 | #
8 | # Modelled after Python’s os.path.join
9 | # https://docs.python.org/3.7/library/os.path.html#os.path.join
10 | # Windows not supported
11 | function(join_paths joined_path first_path_segment)
12 | set(temp_path "${first_path_segment}")
13 | foreach(current_segment IN LISTS ARGN)
14 | if(NOT ("${current_segment}" STREQUAL ""))
15 | if(IS_ABSOLUTE "${current_segment}")
16 | set(temp_path "${current_segment}")
17 | else()
18 | set(temp_path "${temp_path}/${current_segment}")
19 | endif()
20 | endif()
21 | endforeach()
22 | set(${joined_path} "${temp_path}" PARENT_SCOPE)
23 | endfunction()
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2023 - Giuseppe Persico
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | curlcpp
2 | =======
3 |
4 | An object-oriented C++ wrapper for cURL tool
5 |
6 | If you want to know a bit more about cURL and libcurl, you should go on the official website http://curl.haxx.se/
7 |
8 | Donate
9 | ======
10 |
11 | Help me to improve this project!
12 |
13 |
14 |
15 |
16 |
17 | Compile and link manually
18 | =========================
19 |
20 | Standalone (static library)
21 | ----------
22 |
23 | ```bash
24 | cd build
25 | cmake ..
26 | make
27 | ```
28 |
29 | Standalone (dynamic/shared library)
30 | ----------
31 |
32 | ```bash
33 | cd build
34 | cmake .. -DBUILD_SHARED_LIBS=SHARED
35 | make
36 | ```
37 |
38 | **Note:** cURL >= 7.34.0 is required.
39 |
40 | When linking curlcpp to your application don't forget to also link `curl`. Example:
41 |
42 | ```bash
43 | g++ -std=c++11 example.cpp -I/usr/local/include/curlcpp/ -lcurlcpp -lcurl
44 | ```
45 |
46 | Submodule
47 | ---------
48 |
49 | When using a git submodule and CMake-buildsystem, add the following lines to your `CMakeLists.txt`:
50 |
51 | ```
52 | ADD_SUBDIRECTORY(ext/curlcpp) # Change `ext/curlcpp` to a directory according to your setup
53 | INCLUDE_DIRECTORIES(${CURLCPP_SOURCE_DIR}/include)
54 | ```
55 |
56 |
57 | Install via Homebrew
58 | ====================
59 |
60 | curlcpp is now available also via homebrew package manager:
61 |
62 | ```bash
63 | brew install curlcpp
64 | ```
65 |
66 |
67 | Examples
68 | ========
69 |
70 | Here are some usage examples. You will find more examples in the test folder!
71 |
72 | Here's an example of a simple HTTP request to get google web page, using the curl_easy interface:
73 |
74 | * ### Simple request
75 |
76 | `````c++
77 | #include "curlcpp/curl_easy.h"
78 |
79 | using curl::curl_easy;
80 | using curl::curl_easy_exception;
81 | using curl::curlcpp_traceback;
82 |
83 | /**
84 | * This example shows how to make a simple request with curl.
85 | */
86 | int main() {
87 | // Easy object to handle the connection.
88 | curl_easy easy;
89 |
90 | // Add some options.
91 | easy.add("http://");
92 | easy.add(1L);
93 |
94 | try {
95 | easy.perform();
96 | } catch (curl_easy_exception &error) {
97 | // If you want to print the last error.
98 | std::cerr< ios(stream);
130 |
131 | // Declaration of an easy object
132 | curl_easy easy(ios);
133 |
134 | // Add some option to the curl_easy object.
135 | easy.add("http://");
136 | easy.add(1L);
137 |
138 | try {
139 | easy.perform();
140 |
141 | // Retrieve information about curl current session.
142 | auto x = easy.get_info();
143 |
144 | /**
145 | * get_info returns a curl_easy_info object. With the get method we retrieve
146 | * the std::pair object associated with it: the first item is the return code of the
147 | * request. The second is the element requested by the specified libcurl macro.
148 | */
149 | std::cout<
168 |
169 | #include "curlcpp/curl_easy.h"
170 | #include "curlcpp/curl_pair.h"
171 | #include "curlcpp/curl_form.h"
172 | #include "curlcpp/curl_exception.h"
173 |
174 | using std::string;
175 |
176 | using curl::curl_form;
177 | using curl::curl_easy;
178 | using curl::curl_pair;
179 | using curl::curl_easy_exception;
180 | using curl::curlcpp_traceback;
181 |
182 | int main(int argc, const char * argv[]) {
183 | curl_form form;
184 | curl_easy easy;
185 |
186 | // Forms creation
187 | curl_pair name_form(CURLFORM_COPYNAME,"user");
188 | curl_pair name_cont(CURLFORM_COPYCONTENTS,"you username here");
189 | curl_pair pass_form(CURLFORM_COPYNAME,"passw");
190 | curl_pair pass_cont(CURLFORM_COPYCONTENTS,"your password here");
191 |
192 | try {
193 | // Form adding
194 | form.add(name_form,name_cont);
195 | form.add(pass_form,pass_cont);
196 |
197 | // Add some options to our request
198 | easy.add("http://");
199 | easy.add(false);
200 | easy.add(form.get());
201 | // Execute the request.
202 | easy.perform();
203 |
204 | } catch (curl_easy_exception &error) {
205 | // If you want to get the entire error stack we can do:
206 | curlcpp_traceback errors = error.get_traceback();
207 | // Otherwise we could print the stack like this:
208 | error.print_traceback();
209 | }
210 | return 0;
211 | }
212 | `````
213 |
214 | * ### Store response in a file
215 |
216 | And if we would like to put the returned content in a file? Nothing easier than:
217 |
218 | `````c++
219 | #include
220 | #include
221 | #include
222 |
223 | #include "curlcpp/curl_easy.h"
224 | #include "curlcpp/curl_ios.h"
225 | #include "curlcpp/curl_exception.h"
226 |
227 | using std::cout;
228 | using std::endl;
229 | using std::ostream;
230 | using std::ofstream;
231 |
232 | using curl::curl_easy;
233 | using curl::curl_ios;
234 | using curl::curl_easy_exception;
235 | using curl::curlcpp_traceback;
236 |
237 | int main(int argc, const char * argv[]) {
238 | // Create a file
239 | ofstream myfile;
240 | myfile.open ("/path/to/your/file");
241 |
242 | // Create a curl_ios object to handle the stream
243 | curl_ios writer(myfile);
244 | // Pass it to the easy constructor and watch the content returned in that file!
245 | curl_easy easy(writer);
246 |
247 | // Add some option to the easy handle
248 | easy.add("http://");
249 | easy.add(1L);
250 | try {
251 | // Execute the request
252 | easy.perform();
253 |
254 | } catch (curl_easy_exception &error) {
255 | // If you want to print the last error.
256 | std::cerr<
272 | #include
273 |
274 | #include "curlcpp/curl_easy.h"
275 | #include "curlcpp/curl_form.h"
276 | #include "curlcpp/curl_ios.h"
277 | #include "curlcpp/curl_exception.h"
278 |
279 | using std::cout;
280 | using std::endl;
281 | using std::ostringstream;
282 |
283 | using curl::curl_easy;
284 | using curl::curl_ios;
285 | using curl::curl_easy_exception;
286 | using curl::curlcpp_traceback;
287 |
288 | int main() {
289 | // Create a stringstream object
290 | ostringstream str;
291 | // Create a curl_ios object, passing the stream object.
292 | curl_ios writer(str);
293 |
294 | // Pass the writer to the easy constructor and watch the content returned in that variable!
295 | curl_easy easy(writer);
296 | // Add some option to the easy handle
297 | easy.add("http://");
298 | easy.add(1L);
299 |
300 | try {
301 | easy.perform();
302 |
303 | // Let's print the stream content
304 | cout<
324 | #include
325 |
326 | #include "curlcpp/curl_easy.h"
327 | #include "curlcpp/curl_form.h"
328 | #include "curlcpp/curl_pair.h"
329 | #include "curlcpp/curl_receiver.h"
330 | #include "curlcpp/curl_exception.h"
331 | #include "curlcpp/curl_sender.h"
332 |
333 | using std::cout;
334 | using std::endl;
335 | using std::string;
336 |
337 | using curl::curl_form;
338 | using curl::curl_easy;
339 | using curl::curl_sender;
340 | using curl::curl_receiver;
341 | using curl::curl_easy_exception;
342 | using curl::curlcpp_traceback;
343 |
344 | int main(int argc, const char * argv[]) {
345 | // Simple request
346 | string request = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n";
347 | // Creation of easy object.
348 | curl_easy easy;
349 | try {
350 | easy.add("http://");
351 | // Just connect
352 | easy.add(true);
353 | // Execute the request.
354 | easy.perform();
355 |
356 | } catch (curl_easy_exception &error) {
357 | // If you want to get the entire error stack we can do:
358 | curlcpp_traceback errors = error.get_traceback();
359 | // Otherwise we could print the stack like this:
360 | error.print_traceback();
361 | }
362 |
363 | // Creation of a sender. You should wait here using select to check if socket is ready to send.
364 | curl_sender sender(easy);
365 | sender.send(request);
366 | // Prints che sent bytes number.
367 | cout<<"Sent bytes: "< receiver;
374 | // Receive the content on the easy handler
375 | receiver.receive(easy);
376 | // Prints the received bytes number.
377 | cout<<"Receiver bytes: "<
397 | #include
398 |
399 | #include "curlcpp/curl_easy.h"
400 | #include "curlcpp/curl_multi.h"
401 | #include "curlcpp/curl_ios.h"
402 |
403 | using curl::curl_easy;
404 | using curl::curl_multi;
405 | using curl::curl_ios;
406 | using curl::curl_easy_exception;
407 | using curl::curlcpp_traceback;
408 |
409 | /**
410 | * This example shows how to make multiple requests
411 | * using curl_multi interface.
412 | */
413 | int main() {
414 | std::vector urls;
415 | urls.emplace_back("https://google.com");
416 | urls.emplace_back("https://facebook.com");
417 | urls.emplace_back("https://linkedin.com");
418 |
419 | // Create a vector of curl easy handlers.
420 | std::vector handlers;
421 |
422 | // Create a vector of curl streams.
423 | std::vector> streams;
424 |
425 | // Create the curl easy handler and associated the streams with it.
426 | for (const auto & url : urls) {
427 | auto *output_stream = new std::ostringstream;
428 | curl_ios curl_stream(*output_stream);
429 |
430 | curl_easy easy(curl_stream);
431 | easy.add(url.c_str());
432 | easy.add(1L);
433 |
434 | streams.emplace_back(curl_stream);
435 | handlers.emplace_back(easy);
436 | }
437 |
438 | // Create a map of curl pointers to output streams.
439 | std::unordered_map*> easy_streams;
440 | for (int i = 0; i < handlers.size(); ++i) {
441 | easy_streams[handlers.at(i).get_curl()] = (curl_ios*)&streams.at(i);
442 | }
443 |
444 | // Add all the handlers to the curl multi object.
445 | curl_multi multi;
446 | multi.add(handlers);
447 |
448 | try {
449 | // Start the transfers.
450 | multi.perform();
451 |
452 | // Until there are active transfers, call the perform() API.
453 | while (multi.get_active_transfers()) {
454 | multi.perform();
455 |
456 | // Extracts the first finished request.
457 | std::unique_ptr message = multi.get_next_finished();
458 | if (message != nullptr) {
459 | const curl_easy *handler = message->get_handler();
460 |
461 | // Get the stream associated with the curl easy handler.
462 | curl_ios stream_handler = *easy_streams[handler->get_curl()];
463 |
464 | auto content = stream_handler.get_stream()->str();
465 | auto url = handler->get_info();
466 | auto response_code = handler->get_info();
467 | auto content_type = handler->get_info();
468 | auto http_code = handler->get_info();
469 |
470 | std::cout << "CODE: " << response_code.get()
471 | << ", TYPE: " << content_type.get()
472 | << ", HTTP_CODE: " << http_code.get()
473 | << ", URL: " << url.get()
474 | << ", CONTENT: " << content.substr(0, 10) + " ... "
475 | << std::endl;
476 | }
477 | }
478 |
479 | // Free the memory allocated for easy streams.
480 | for (auto stream : streams) {
481 | delete stream.get_stream();
482 | }
483 |
484 | } catch (curl_easy_exception &error) {
485 | // If you want to print the last error.
486 | std::cerr<
30 |
31 | #include "curl_exception.h"
32 | #include "cookie_datetime.h"
33 |
34 | namespace curl {
35 | /**
36 | * This class allows to specify every single field of an http-style cookie.
37 | */
38 | class cookie {
39 | public:
40 | /**
41 | * Default constructor.
42 | */
43 | cookie() = default;
44 | /**
45 | * The overloaded constructor allow a fast way to build a cookie.
46 | */
47 | cookie(const std::string&, const std::string&, const cookie_datetime &,
48 | const std::string& = "", const std::string& = "", bool = false);
49 | /**
50 | * This constructor overloades the previous one.
51 | */
52 | cookie(const char *, const char *, const cookie_datetime &, const char * = "",
53 | const char * = "", bool = false);
54 | /**
55 | * This method allows to specify the cookie name.
56 | */
57 | cookie *set_name(const std::string&);
58 | /**
59 | * This method overloads the previous one allowing to specify a const char *
60 | * instead of a string.
61 | */
62 | cookie *set_name(const char *);
63 | /**
64 | * This method allows to specify the cookie value.
65 | */
66 | cookie *set_value(const std::string&);
67 | /**
68 | * This method allows to specify the cookie value,
69 | */
70 | cookie *set_value(const char *);
71 | /**
72 | * This method allows to specify the cookie path.
73 | */
74 | cookie *set_path(const std::string&) NOEXCEPT;
75 | /**
76 | * This method overloads the previous one allowing to specify a const char *
77 | * instead of a string.
78 | */
79 | cookie *set_path(const char *) NOEXCEPT;
80 | /**
81 | * This method allows to specify the cookie domain.
82 | */
83 | cookie *set_domain(const std::string&) NOEXCEPT;
84 | /**
85 | * This method overloads the previous one allowing to specify a const char *
86 | * instead of a string.
87 | */
88 | cookie *set_domain(const char *) NOEXCEPT;
89 | /**
90 | * This method allows to specify the cookie security.
91 | */
92 | cookie *set_secure(bool) NOEXCEPT;
93 | /**
94 | * This method overloads the previous one allowing to specify an integer instead
95 | * of a bool.
96 | */
97 | cookie *set_secure(unsigned int);
98 | /**
99 | * This method overloads the previous one allowing to specify a string to indicate
100 | * whether the cookie is secure (with "secure" keyword) or not (empty string).
101 | */
102 | cookie *set_secure(const std::string&) NOEXCEPT;
103 | /**
104 | * This method overloads the previous one allowing to specify a string to indicate
105 | * whether the cookie is secure (with "secure" keyword) or not (empty string).
106 | */
107 | cookie *set_secure(const char *) NOEXCEPT;
108 | /**
109 | * This method allows to specify a datetime expiration to this cookie.
110 | */
111 | cookie *set_datetime(const cookie_datetime &) NOEXCEPT;
112 | /**
113 | * This method returns the cookie name.
114 | */
115 | std::string get_name() const NOEXCEPT;
116 | /**
117 | * This method returns the cookie value.
118 | */
119 | std::string get_value() const NOEXCEPT;
120 | /**
121 | * This method returns the cookie path.
122 | */
123 | std::string get_path() const NOEXCEPT;
124 | /**
125 | * This method returns the cookie domain.
126 | */
127 | std::string get_domain() const NOEXCEPT;
128 | /**
129 | * This method returns the datetime expire object for this cookie.
130 | */
131 | cookie_datetime get_datetime() const NOEXCEPT;
132 | /**
133 | * This method returns the cookie security.
134 | */
135 | bool is_secure() const NOEXCEPT;
136 | /**
137 | * This method allows to get a string representing the entire cookie. Example:
138 | * 'Set-cookie: name=xxx; path=/; domain=/ expires=date'
139 | */
140 | std::string get_formatted() NOEXCEPT;
141 | private:
142 | /**
143 | * The cookie name.
144 | */
145 | std::string name;
146 | /**
147 | * Il valore del cookie.
148 | */
149 | std::string value;
150 | /**
151 | * The cookie path.
152 | */
153 | std::string path;
154 | /**
155 | * The cookie domain.
156 | */
157 | std::string domain;
158 | /**
159 | * The cookie expire date and time.
160 | */
161 | cookie_datetime datetime;
162 | /**
163 | * The cookie security.
164 | */
165 | bool secure;
166 | };
167 | }
168 |
169 | #endif //CURLCPP_COOKIE_H
--------------------------------------------------------------------------------
/include/cookie_date.h:
--------------------------------------------------------------------------------
1 | /**
2 | * The MIT License (MIT)
3 | *
4 | * Copyright (c) 2023 - Giuseppe Persico
5 | * File - cookie_date.h
6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy
8 | * of this software and associated documentation files (the "Software"), to deal
9 | * in the Software without restriction, including without limitation the rights
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | * copies of the Software, and to permit persons to whom the Software is
12 | * furnished to do so, subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be included in all
15 | * copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | * SOFTWARE.
24 | */
25 |
26 | #ifndef CURLCPP_COOKIE_DATE_H
27 | #define CURLCPP_COOKIE_DATE_H
28 |
29 | #include
30 | #include