pica/handler/register.cpp

24 lines
612 B
C++

// SPDX-FileCopyrightText: 2023 Yury Gubich <blue@macaw.me>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "register.h"
Handler::Register::Register():
Handler("register", Request::Method::post)
{}
void Handler::Register::handle(Request& request) {
std::map form = request.getForm();
std::cout << "Received form:" << std::endl;
for (const auto& pair : form)
std::cout << '\t' << pair.first << ": " << pair.second << std::endl;
Response res(request);
nlohmann::json body = nlohmann::json::object();
body["result"] = "ok";
res.setBody(body);
res.send();
}