if (m_capability[name].asString() == value)
json_str = "{\"support\":1}";
}
+ } else if (prequest->path.find("/execute_command") != string::npos) {
+ Json::Value paras = splitContent(prequest->content);
+ std::string cmd = paras["cmd"].asString();
+ std::vector<std::string> output;
+ run_cmd(cmd, "", &output);
+
+ json_str = "{\"Input_value\" : \"" + cmd + "\"\n\"Output\" : [";
+ for(auto line : output) {
+ json_str += "\"" + line + "\", ";
+ }
+ json_str = json_str.substr(0, json_str.size() - 2);
+ json_str += "]}";
} else {
json_str = "{\"Error\":\"unknown request\"}";
}