We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ac757ff + 1681ff2 commit e3ba10dCopy full SHA for e3ba10d
examples/example_with_all.cpp
@@ -81,15 +81,15 @@ int main()
81
82
// more json example
83
CROW_ROUTE(app, "/add_json")
84
- ([](const crow::request& req) {
85
- auto x = crow::json::load(req.body);
86
- if (!x)
87
- return crow::response(400);
88
- int sum = x["a"].i() + x["b"].i();
89
- std::ostringstream os;
90
- os << sum;
91
- return crow::response{os.str()};
92
- });
+ .methods("POST"_method)([](const crow::request& req) {
+ auto x = crow::json::load(req.body);
+ if (!x)
+ return crow::response(400);
+ int sum = x["a"].i() + x["b"].i();
+ std::ostringstream os;
+ os << sum;
+ return crow::response{os.str()};
+ });
93
94
CROW_ROUTE(app, "/params")
95
([](const crow::request& req) {
0 commit comments