#ifndef DREQUEST_H #define DREQUEST_H #include "core/string.h" #include "core/containers/vector.h" #include "core/http/request.h" #include #include "http/HttpRequestImpl.h" #include "http/HttpResponse.h" #include "core/http/handler_instance.h" //using namespace drogon; class DrogonWebServer; class DRequest : public Request { public: drogon::HttpRequestImplPtr request; std::function callback; const String get_cookie(const String &key); void add_cookie(const ::Cookie &cookie); void remove_cookie(const String &key); HTTPMethod get_method() const; const String get_parameter(const String &key) const; void send_redirect(const String &location, const HTTPStatusCode status_code = HTTP_STATUS_CODE_302_FOUND); void send(); void send_file(const String &p_file_path); void reset(); String parser_get_path(); String get_host() const; void update(); static DRequest *get(); static void pool(DRequest *request); void pool(); DRequest(); ~DRequest(); protected: void _progress_send_file(); void _file_chunk_sent(); void _response_additional_setup(const drogon::HttpResponsePtr &req); Vector _path_stack; uint32_t _path_stack_pointer; Vector<::Cookie> _added_cookies; Vector _removed_cookies; private: static RequestPool _request_pool; }; #endif