-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJsonController.h
More file actions
36 lines (31 loc) · 893 Bytes
/
JsonController.h
File metadata and controls
36 lines (31 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _MONGOOSE_JSON_CONTROLLER_H
#define _MONGOOSE_JSON_CONTROLLER_H
#include "Request.h"
#include "Response.h"
#include "WebController.h"
#include "JsonResponse.h"
using namespace std;
/**
* A json controller is a controller that serves JSON API
*/
namespace Mongoose
{
class JsonController : public WebController
{
public:
/**
* Creates a json controller, each gcDivisor request, the sessions will be
* garbage collected
*/
JsonController(int gcDivisor = 100);
/**
* Pre process the request, this will set the content type to text/html
* and ping the user session
*
* @param Request the request
* @param Response the response
*/
void preProcess(Request &request, Response &response);
};
}
#endif