diff options
| author | Comment <tim@gray.(none)> | 2013-11-02 16:13:41 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-11-02 16:13:41 +0000 |
| commit | 510a5218d5e981db3dde9ed31ddc6f732ed6a22a (patch) | |
| tree | b9d09c4dbdefed1ec693e0492841cde426ef6643 /rotord/src/rotord.cpp | |
| parent | 8864f5da9649c176e472a7fb8913dd8114deec54 (diff) | |
| parent | eaccb1437465c6aa49e1d5511876852543e3b0fa (diff) | |
merge branch
Diffstat (limited to 'rotord/src/rotord.cpp')
| -rw-r--r-- | rotord/src/rotord.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rotord/src/rotord.cpp b/rotord/src/rotord.cpp index de853e4..c4c562e 100644 --- a/rotord/src/rotord.cpp +++ b/rotord/src/rotord.cpp @@ -212,8 +212,20 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS } } else if (command[0]=="listnode") { - XML.pushTag("rotor"); if (request.getMethod()=="GET") { + if (command.size()>1){ + if (command[1]=="json") { + Json::Value root; + Json::StyledWriter writer; + + Node_factory factory; + factory.list_node(body,root); + string content = writer.write(root); + status=HTTPResponse::HTTP_OK; + return new RenderContextHandler(content, status); + } + } + XML.pushTag("rotor"); Node_factory factory; if (factory.list_node(body,XML)) status=HTTPResponse::HTTP_OK; } |
