Remove API Key and Update Callback
This commit is contained in:
+34
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user