Pistache
Pistache
is a C++ REST framework written by Mathieu Stefani at Datacratic.
It is written in pure C++11 with no external dependency and provides a low-level HTTP abstraction.
Pistache
provides both an HTTP client and server that can be used to create and query complex web and REST APIs.
Modern API
Playing with Pistache and its API is fun
, clean
, easy
and fast
struct HelloHandler : public Http::Handler {
void onRequest(const Http::Request& req, Http::ResponseWriter response) {
response.send(Http::Code::Ok, "Hello, World");
}
};
int main() {
Http::listenAndServe<HelloHandler>("*:9080");
}
curl http://127.0.0.1:9080
Hello, World