Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wolgemoth/curl-wrapper

A C++ wrapper for libcurl with a cleaner scripting interface and async functionality.
https://github.com/wolgemoth/curl-wrapper

async asynchronous concurrency concurrent cpp cpp17 curl encapsulation header-only http https libcurl networking protocol requests rest rest-api restful-api web

Last synced: about 8 hours ago
JSON representation

A C++ wrapper for libcurl with a cleaner scripting interface and async functionality.

Awesome Lists containing this project

README

        

# CURL Wrapper (Requests.hpp)

### About

This is a a C++ wrapper for libcurl that provides a cleaner scripting interface and support for asynchronous requests.

It works on a RAII basis and hides any raw pointers exposed by the CURL library through the use of encapsulation. It also provides several utility functions such as checking the status of a request.

If you find a bug or have a feature-request, please raise an issue.

### Example

```cpp
(On program start ...)
Networking::Requests::Init();

(Runtime...)
auto message = Networking::Requests::Client(query);
message.Set(CURLOPT_TIMEOUT, 20);

auto response = message.Send();

(Finalisation...)
Networking::Requests::Dispose();
```

### Dependencies

#### [libcurl](https://curl.se/libcurl/)

### Instructions

The implementation is header-only and written in templated C++17. You should need not need to make any adjustments to your project settings or compiler flags.

Simply include the header and dependencies in your project and you are ready to start!