uhttpd add new rest mechanism. rest like.

This commit is contained in:
jbnadal
2018-05-22 14:50:36 +02:00
parent 81442524a3
commit 68c0d02078
10 changed files with 194 additions and 170 deletions

View File

@@ -49,7 +49,7 @@ class RestController : public WebController
public:
RestController(void);
RestController(const std::string &a_path, const std::string &a_method_get = "", const std::string &a_method_put = "", int a_timeout = kDefaultTimeout, bool a_raw_response = false);
virtual ~RestController(void);
~RestController(void);
WebConnection *new_connection(struct uhttpd_ops *an_ops, struct client *a_client, const std::string &a_parameters);
@@ -65,33 +65,17 @@ class RestController : public WebController
bool is_raw_response(void);
/*
std::string get_method_get(void);
std::string get_method_put(void);
uint16_t get_timeout(void);
std::string get_method(uint8_t a_method);
*/
protected:
uint8_t m_method;
std::string m_endpoint;
Ubus m_ubus;
bool mf_raw_response;
/*
std::string m_name;
std::string m_path;
std::string m_method_get;
std::string m_method_put;
uint16_t m_timeout;
*/
private:
private:
void manage_endpoint(void);
std::string m_parameter_name;
std::size_t m_parameter_position;
std::string m_controller;
};
#endif /* _REST_CONTROLLER_H */