qmetrics.net

cpr

C++17 HTTP client wrapper inspired by Python Requests

cpr screenshot

C++ Requests wraps libcurl with concise C++17 APIs for GET, POST, auth, proxies, and async calls. It can be linked via CMake FetchContent, packages, or system installs.

Overview

C++ Requests (cpr) is a library that wraps libcurl to make HTTP calls more idiomatic in modern C++. It was inspired by Python's Requests project and targets developers who want fewer low-level curl mistakes while keeping libcurl underneath.

The API covers common verbs, custom headers, URL-encoded and multipart bodies, file uploads, several authentication modes, cookies, proxies, timeouts, callbacks, and asynchronous requests. HTTPS can use OpenSSL or WinSSL; Server-Sent Events and thread-safe libcurl access are also supported.

Integration paths include CMake FetchContent, find_package after install, Bazel modules, vcpkg, Conan, Meson wraps, Linux distribution packages, a Windows NuGet build, and MacPorts on macOS. Dependencies beyond a C++17 compiler are mainly OpenSSL when HTTPS is required.

Documentation and examples illustrate simple GET flows contrasted with raw libcurl code. Maintainers note that using a system libcurl requires a sufficiently recent version when not bundling curl.

Key features

  • libcurl wrapper with concise API
  • GET POST PUT DELETE and more
  • Basic digest NTLM bearer auth
  • Multipart and file uploads
  • Async requests and callbacks
  • Proxy and cookie support
  • OpenSSL or WinSSL HTTPS
  • CMake vcpkg Conan packaging

Use cases

  • REST clients in C++ services
  • Downloading APIs from native tools
  • Replacing verbose libcurl calls
  • HTTPS integrations on Windows
  • Embedded HTTP in CMake projects

Tags

Similar software

axios

Promise-based HTTP client for browser and Node.js

Axios is a promise-based HTTP client for JavaScript environments in the browser and Node.js. It supports common request methods, configurable defaults, and interceptors for request and response handling.

★ 109.5k⟳ 2 days agoMIT

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

OmniRoute

OpenAI-compatible AI gateway with provider routing

OmniRoute exposes one endpoint that routes chat requests across many LLM providers with quota-aware fallback and compression.

★ 90.7k⟳ todayMIT

Hoppscotch

Web, desktop and CLI API development ecosystem

Hoppscotch lets developers send HTTP, WebSocket, GraphQL, and related API requests from a lightweight client. Collections, environments, teams, and sync help organize testing across devices.

★ 81k⟳ 5 days agoMIT
Open Source Alternative to:Postman

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

JSON Server

Zero-code mock REST API from JSON data files

JSON Server turns a JSON or JSON5 database file into a REST API for local prototyping. It supports filtering, sorting, pagination, embedding relations, and static assets.

★ 75.7k⟳ 8 months agoMIT