You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, could I get full documentation or post example? I want to recive Post's like http:/example.com/login/?username=tester&password=myPassword
But I don't understand the only example which I've found in readme.md
Or mayby any idea how url would looks like for this:
CROW_ROUTE(app, "/add_json")
.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()};
});
The text was updated successfully, but these errors were encountered:
In this case the request (HTTP) body is expected to be JSON data.
Example
{"a": 1, "b": 2}
If you want query values, you have to access crow::request::url_params (crow/http_request.h:29) on which these are some of the ways you can interact with it (from crow/query_string.h):
Hey, could I get full documentation or post example? I want to recive Post's like
http:/example.com/login/?username=tester&password=myPassword
But I don't understand the only example which I've found in readme.md
Or mayby any idea how url would looks like for this:
The text was updated successfully, but these errors were encountered: