mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 05:17:59 +03:00
67 lines
1.3 KiB
C++
67 lines
1.3 KiB
C++
#ifndef REQUEST_HPP
|
|
#define REQUEST_HPP
|
|
|
|
#include "ServerConfig.hpp"
|
|
#include "webserv.hpp"
|
|
|
|
|
|
class Request
|
|
{
|
|
private:
|
|
char *_data;
|
|
|
|
int _ret;
|
|
int _row;
|
|
|
|
std::string _URI;
|
|
std::string _body;
|
|
std::string _host;
|
|
std::string _query;
|
|
std::string _method;
|
|
std::string _fullURI;
|
|
std::string _version;
|
|
std::string _location;
|
|
std::map<std::string, std::string> _headerField;
|
|
|
|
ServerConfig *_config;
|
|
|
|
public:
|
|
std::string getURI(void);
|
|
std::string getBody(void);
|
|
std::string getHost(void);
|
|
std::string getQuery(void);
|
|
std::string getMethod(void);
|
|
std::string getFullUri(void);
|
|
std::string getVersion(void);
|
|
std::string getLocation(void);
|
|
ServerConfig *getConfig(void);
|
|
int getCode(void);
|
|
std::map<std::string, std::string> getHeaderFields(void);
|
|
|
|
void setConfig(ServerConfig *config);
|
|
void setData(char *);
|
|
void setData(char *, ServerConfig *);
|
|
|
|
public:
|
|
|
|
Request();
|
|
Request(char *str);
|
|
int parseStartLine(std::string);
|
|
int parseHeaderfield(std::string);
|
|
int parseRequest(void);
|
|
void parseURI(std::string);
|
|
void printHeaderInfo(void);
|
|
|
|
bool badCode(int);
|
|
int isDir(std::string path);
|
|
int isFile(std::string path);
|
|
bool autoindexOn(void);
|
|
void copyFromMap(void);
|
|
void clear(void);
|
|
|
|
~Request();
|
|
};
|
|
|
|
|
|
|
|
#endif |