A simple, expressive C++17 HTTP client library inspired by Python Requests, built on libcurl.
C++ Requests (cpr) is an open-source C++ library that provides a simple, expressive interface for making HTTP requests. It acts as a wrapper around libcurl, offering a clean API inspired by Python's popular Requests library. It solves the problem of libcurl's complex, error-prone low-level interface by providing modern C++ idioms for common HTTP tasks.
C++ developers who need to integrate HTTP/REST API calls into their applications, especially those familiar with Python Requests or frustrated by libcurl's verbosity. It's suitable for projects ranging from CLI tools to backend services.
Developers choose cpr because it dramatically reduces boilerplate and complexity compared to raw libcurl, while maintaining full power and flexibility. Its Python Requests-like API is intuitive, its modern C++ design is robust, and it handles dependencies like SSL and threading transparently.
C++ Requests: Curl for People, a spiritual port of Python Requests.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers chainable methods like cpr::Get() and cpr::Post() inspired by Python Requests, making HTTP calls straightforward and readable, as shown in the TLDR example with minimal code.
Handles various HTTP methods, authentication types (Basic, Bearer, Digest, NTLM), cookies, timeouts, proxies, and advanced features like HTTPS via OpenSSL/WinSSL, covering most common use cases listed in the features section.
Using fetch_content automatically manages libcurl and SSL dependencies, simplifying build setup as demonstrated in the CMake section, with no manual handling required.
Maintained by active contributors with recent releases, online documentation, and community chat on Gitter, indicated by CI badges and announcements for ongoing support.
Current versions require C++17, which excludes projects using older compilers or standards, and support for C++11 is only in unsupported releases (<=1.9.x).
Requires libcurl >= 7.71.0 when using system curl, limiting compatibility with older systems like Debian <11 or Ubuntu <22.04 LTS, as noted in the requirements.
Integration with Bazel requires manual patches and configuration files, as shown in the Bazel section, which can be error-prone and less straightforward than CMake.