request handler?

This commit is contained in:
Jonas Zeunert
2019-04-15 13:52:53 +02:00
parent 865772214b
commit 4c7b490300

View File

@@ -4,6 +4,8 @@
#include "OutputRequestHandler.h"
#include <Poco/Net/HTTPServerResponse.h>
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/URI.h>
#include <Poco/Exception.h>
namespace flippR_driver
@@ -20,13 +22,14 @@ OutputRequestHandler::OutputRequestHandler(std::shared_ptr<output::OutputDriver>
void OutputRequestHandler::handleRequest(HTTPServerRequest &request,
HTTPServerResponse &response)
{
auto& path_segments = getPathSegments(URI(request.getPathSegments()));
auto& path_segments = getPathSegments(URI(request.getURI()));
std::string item_type = path_segments.at(0);
std::string item_name = path_segments.at(1);
std::string action = path_segments.at(2);
std::string score = "";
request.
if(item_type == "displays")
{
score = path_segments.at(3);
@@ -155,6 +158,7 @@ void OutputRequestHandler::parseDisplay(const std::string& item_name, const std:
throw new Poco::NotFoundException("No Action with name \"" + action + "\" on sounds!");
}
}
std::vector<std::string> OutputRequestHandler::getPathSegements(Poco::URI uri)
{
std::vector<std::string> path_segments;