Major Update: Link Library
[link.git] / Includes / Link / Request.hpp
blobaa4299be34b84aeb565f2bb8b14763becc80515a
1 /*
2 * ______________________________________
3 * | _ _ _ _ |
4 * | | \ | |/ |/ | Date: 06/24/2022 |
5 * | | \| |- |- | Author: Levi Hicks |
6 * | | || || | |
7 * | | |\ || || | |
8 * | |_| \_||_||_| File: Request.hpp |
9 * | |
10 * | |
11 * | Please do not remove this header. |
12 * |______________________________________|
15 #ifndef Request
16 #include <iostream>
17 #include <map>
18 #include <netinet/in.h>
20 class Request {
21 public:
22 Request(int sock, sockaddr_in* addr, std::string path, std::string method, std::string request, std::map<std::string, std::string> queries);
23 std::string GetRequest();
24 std::string GetPath();
25 std::string GetMethod();
26 std::string GetHeader(std::string header);
27 std::string GetQuery(std::string query);
28 std::string GetBody();
29 std::string GetFormParam(std::string param);
30 int GetSocket();
31 struct sockaddr_in* GetAddress();
32 private:
33 int sock;
34 struct sockaddr_in* addr;
35 std::map<std::string, std::string> headers, queries, params;
36 std::string path, method, request, body;
39 #endif