From b57467a7229d9f59997cd05540a70747482d9ae9 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Sat, 13 Jul 2024 20:57:14 +0300 Subject: [PATCH] fix impl client --- src/trs/trs.hpp | 6 +++--- tests/main.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/trs/trs.hpp b/src/trs/trs.hpp index e6b98d5..3b6a426 100644 --- a/src/trs/trs.hpp +++ b/src/trs/trs.hpp @@ -120,16 +120,16 @@ namespace trs ~client() = default; public: - auto post(std::string path, JSON&& data) + auto post(std::string func_name, JSON&& data) { httplib::Headers headers = { { "TRS-server-token", m_token }, - { "TRS-server-function", "notify" }, + { "TRS-server-function", func_name }, { "Content-Type", "application/json" }, { "Cookie", "unione_lang=ru" } }; - return m_cli.Post(path.c_str(), headers, data.dump(),"application/json" ); + return m_cli.Post("/", headers, data.dump(),"application/json" ); } private: diff --git a/tests/main.cpp b/tests/main.cpp index 8f5f318..30a4a6a 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -27,7 +27,7 @@ namespace worckspaces auto main(int argc, char* args[]) -> int { // trs::client cli {"localhost:5000", "token_auth"}; - // cli.post("/",trs::JSON{{ "key", "test message" }}); + // cli.post("func_name",trs::JSON{{ "key", "test message" }}); trs::server srv; srv.init("test service", "app_connection", "log_connection");