Remove API Key and Update Callback

This commit is contained in:
2020-06-10 22:15:14 +02:00
parent e5ef4d886a
commit 4d8f132df9
8 changed files with 114 additions and 15 deletions
+34 -1
View File
@@ -14,7 +14,40 @@ class HttpServerImpl;
class HttpServer
{
public:
HttpServer(unsigned short port, std::function<std::string(const std::string&, const std::vector<HttpPostData>&)> callback);
struct HttpReply
{
struct Status
{
enum type
{
Ok = 200,
Created = 201,
Accepted = 202,
NoContent = 204,
MultipleChoices = 300,
MovedPermanently = 301,
MovedTemporarily = 302,
NotModified = 304,
BadRequest = 400,
Unauthorized = 401,
Forbidden = 403,
NotFound = 404,
InternalServerError = 500,
NotImplemented = 501,
BadGateway = 502,
ServiceUnavailable = 503
};
};
Status::type status;
std::string content;
};
public:
typedef std::function<HttpReply(const std::string&, const std::vector<HttpPostData>&)> CallbackMethod;
public:
HttpServer(unsigned short port, CallbackMethod callback);
~HttpServer();
void Wait();