Open marosiak opened 6 years ago
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):
char* query_string::get(const std::string& name) const;
std::vector<char*> query_string::get_list(const std::string& name) const;
std::unordered_map<std::string, std::string> query_string::get_dict(const std::string& name) const;
In particular, if you wanted to get "username"
and "password"
:
const auto username = req.url_params.get("username");
const auto password = req.url_params.get("password");
I hope that helps. Feel free to look through the code, it helps a lot to understand how to use it.
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.mdOr mayby any idea how url would looks like for this: