Light libcurl wrapper for when you need to GET a website with minimum effort.
Go to file
tastytea f09f01e220
Add readme and license.
2020-11-08 15:08:31 +01:00
src Revert to ASCII-only case insensitivity for get_header(). 2020-11-08 14:35:09 +01:00
tests Revert to ASCII-only case insensitivity for get_header(). 2020-11-08 14:35:09 +01:00
.gitignore Initial commit. 2020-11-03 22:53:20 +01:00
CMakeLists.txt Add readme and license. 2020-11-08 15:08:31 +01:00
LICENSE Add readme and license. 2020-11-08 15:08:31 +01:00
README.adoc Add readme and license. 2020-11-08 15:08:31 +01:00

README.adoc

Simple libcurl wrapper for when you need to GET a website with minimum effort.

This is not supposed to be a package on its own, but a thing you drop into your project.

I made this because the curl wrapper I used before is no longer maintained and the other wrappers are either incomplete or unmaintained as well.

Example program

#include "curl_wrapper.hpp"
#include <iostream>

namespace cw = curl_wrapper;

cw::CURLWrapper curl;
const auto answer{curl.make_http_request(cw::http_method::GET,
                                         "http://example.com/")};
if (answer)
{
    std::cout << answer;
}

Use with CMake

Drop this project into a subfolder in your project tree. It will be compiled as a static library.

add_subdirectory(curl_wrapper)

add_executable(test)
target_link_libraries(test PRIVATE curl_wrapper)
CMake options:
  • -DWITH_TESTS=YES compiles the tests.

Dependencies

  • C++17

  • CMake >=3.9

  • libcurl >= 7.52