Added name of requests to be used by GUI

This commit is contained in:
Konrad 2017-03-25 18:23:28 +01:00
parent ae95b49f8a
commit 39967b7ce7
3 changed files with 13 additions and 0 deletions

View File

@ -368,6 +368,9 @@ std::string ApiServer::handleRequest(Request &request)
if(data.isRawData())
return data.getRawData();
if(!resp.mCallbackName.empty())
outstream << resource_api::makeKeyValueReference("callback_name", resp.mCallbackName);
outstream << resource_api::makeKeyValue("debug_msg", debugString.str());
outstream << resource_api::makeKeyValueReference("returncode", returncode);
if(!resp.mStateToken.isNull())

View File

@ -252,6 +252,9 @@ public:
StateToken mStateToken;
//Just for GUI benefit
std::string mCallbackName;
// the result
StreamBase& mDataStream;

View File

@ -37,6 +37,13 @@ ResponseTask* ResourceRouter::handleRequest(Request& req, Response& resp)
if(vit->first == req.mPath.top())
{
req.mPath.pop();
//Just for GUI benefit
std::string callbackName;
req.mStream << makeKeyValueReference("callback_name", callbackName);
resp.mCallbackName = callbackName;
//
return vit->second->handleRequest(req, resp);
}
}