From 6b49c684c5745f0c5fde1678fe6b89a89696c056 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Fri, 1 Sep 2023 09:25:51 -0700 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-12868 Signed-off-by: stephb9959 --- src/framework/RESTAPI_Handler.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/framework/RESTAPI_Handler.h b/src/framework/RESTAPI_Handler.h index a7ed6817..b74d6e75 100644 --- a/src/framework/RESTAPI_Handler.h +++ b/src/framework/RESTAPI_Handler.h @@ -574,6 +574,16 @@ namespace OpenWifi { Poco::JSON::Stringifier::stringify(Object, Answer); } + inline void ReturnObject(const std::vector &Strings) { + Poco::JSON::Array Arr; + for(const auto &String:Strings) { + Arr.add(String); + } + std::ostringstream os; + Arr.stringify(os); + return ReturnRawJSON(os.str()); + } + inline void ReturnRawJSON(const std::string &json_doc) { PrepareResponse(); if (Request != nullptr) {