Building RESTful Interfaces in C++ With nlohmann and cpp-httplib
summary
Builds a working REST API stack in C++ using nlohmann::json and cpp-httplib, with header-only libraries and a small in-house scaffold; code (server + client) is on GitHub and compiles. It runs in payments production (processing ~700M transactions in 10 months), meets 22s network timeouts to card networks, uses ZeroMQ for internal messaging, prefers strong types via from_json/to_json, treats DELETE as disallowed and uses PUT/POST for updates and voids, and notes the client is blocking.
AI-written summary · about
chapters (13)
- 0:00Credit card processing intro
- 3:10CRUD and REST basics
- 7:01REST constraints and architecture
- 12:37JSON over XML for APIs
- 16:54Header-only libraries and performance
- 22:13Basic HTTP server with REST endpoints
- 31:58Routing and security setup
- 38:39nlohmann JSON for API requests
- 44:17URI parameters and updates
- 47:31HTTP client for testing
- 51:07Live demo: server and client
- 54:44Lessons learned and best practices
- 56:53Summary and GitHub repo








