/
vint10tov
/
HomeServer
Обзор
Документация
Войти
/
vint10tov
/
HomeServer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Header/request.hpp
34 строки
1 KB
vint10tov
rt
10 ноя 2024, 13:19
10 ноя 2024, 13:19
635f469
Код
Авторство
О чём код?
// запрос # pragma once #include <unordered_map> #include <string> #include "logger.hpp" class Request { public: Request(char * buffer, int bytes_read); ~Request() {} enum class Method {GET, POST, HEAD, PUT, DELETE, OPTIONS, PATCH, ERROR}; //int GET_begin_request_body() const {return begin_request_body;} Method GET_method() const {return method;} const std::string & GET_url() const {return url;} const std::string & GET_version() const {return version;} std::string GET_headlines(const std::string& key) const; void Show_RequestHeders() const; std::string reading_request_body(); private: int bytes_read; char * buffer; // начало тела int begin_request_body = 0; // метод запроса Method method; // url std::string url; // версия http std::string version; // заголовки std::unordered_map<std::string, std::string> headlines; };