jll*_*dra 21 c c++ json web-services
我试图用C/C++做一个JSON Restful Web服务.我已经尝试过Axis2/C和Staff,它非常适合XML序列化/反序列化,但不适用于JSON.
有少数库支持使用 c 创建休息服务,例如restinio:
#include <restinio/all.hpp>
int main()
{
restinio::run(
restinio::on_this_thread()
.port(8080)
.address("localhost")
.request_handler([](auto req) {
return req->create_response().set_body("Hello, World!").done();
}));
return 0;
}
Run Code Online (Sandbox Code Playgroud)