generated from Sithas/conan_template
Успешный парсинг JSON
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/json.hpp>
|
||||
#include <mysqlx/xdevapi.h>
|
||||
#include <mysqlx/common/api.h>
|
||||
|
||||
@@ -25,7 +26,11 @@ public:
|
||||
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
|
||||
) override
|
||||
{
|
||||
auto metadata = user_dao_->GetAll();
|
||||
auto body = req.body();
|
||||
boost::json::object json_as_object = boost::json::parse(body).as_object();
|
||||
|
||||
std::string login = boost::json::serialize(json_as_object.at("login").as_string());
|
||||
std::string password = boost::json::serialize(json_as_object.at("password").as_string());
|
||||
|
||||
boost::beast::http::response<ResponseType> res{
|
||||
boost::beast::http::status::ok, req.version()
|
||||
|
||||
Reference in New Issue
Block a user