mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-03 03:57:55 +00:00
RESTAPI Shell
This commit is contained in:
40
src/RESTAPI_inventory_handler.cpp
Normal file
40
src/RESTAPI_inventory_handler.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Created by stephane bourque on 2021-08-16.
|
||||
//
|
||||
|
||||
#include "RESTAPI_inventory_handler.h"
|
||||
|
||||
namespace OpenWifi{
|
||||
void RESTAPI_inventory_handler::handleRequest(Poco::Net::HTTPServerRequest &Request,
|
||||
Poco::Net::HTTPServerResponse &Response) {
|
||||
if (!ContinueProcessing(Request, Response))
|
||||
return;
|
||||
|
||||
if (!IsAuthorized(Request, Response))
|
||||
return;
|
||||
|
||||
ParseParameters(Request);
|
||||
if(Request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET)
|
||||
DoGet(Request, Response);
|
||||
else if (Request.getMethod() == Poco::Net::HTTPRequest::HTTP_POST)
|
||||
DoPost(Request, Response);
|
||||
else if (Request.getMethod() == Poco::Net::HTTPRequest::HTTP_DELETE)
|
||||
DoDelete(Request, Response);
|
||||
else if (Request.getMethod() == Poco::Net::HTTPRequest::HTTP_PUT)
|
||||
DoPut(Request, Response);
|
||||
else
|
||||
BadRequest(Request, Response, "Unknown HTTP Method");
|
||||
}
|
||||
|
||||
void RESTAPI_inventory_handler::DoGet(Poco::Net::HTTPServerRequest &Request,
|
||||
Poco::Net::HTTPServerResponse &Response) {}
|
||||
|
||||
void RESTAPI_inventory_handler::DoDelete(Poco::Net::HTTPServerRequest &Request,
|
||||
Poco::Net::HTTPServerResponse &Response) {}
|
||||
|
||||
void RESTAPI_inventory_handler::DoPost(Poco::Net::HTTPServerRequest &Request,
|
||||
Poco::Net::HTTPServerResponse &Response) {}
|
||||
|
||||
void RESTAPI_inventory_handler::DoPut(Poco::Net::HTTPServerRequest &Request,
|
||||
Poco::Net::HTTPServerResponse &Response) {}
|
||||
}
|
||||
Reference in New Issue
Block a user