curl_wrapper/README.adoc

52 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-11-08 15:50:14 +01:00
Light libcurl wrapper for when you need to GET a website with minimum effort.
2020-11-08 15:08:31 +01:00
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
[source,cpp]
--------------------------------------------------------------------------------
#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.
[source,cmake]
--------------------------------------------------------------------------------
add_subdirectory(curl_wrapper)
add_executable(test)
target_link_libraries(test PRIVATE curl_wrapper)
--------------------------------------------------------------------------------
.CMake options:
- `-DWITH_CURL_WRAPPER_TESTS=YES` Compiles the tests.
- `-DWITH_CURL_WRAPPER_DOC=YES` Generate API reference.
2020-11-08 15:08:31 +01:00
== Dependencies
- C++17
- CMake >= 3.9
2020-11-08 15:08:31 +01:00
- libcurl >= 7.52
- Optional:
- Tests: Catch >= 1.2
- Documentation: Doxygen >= 1.8