Samchon Framework for CPP  1.0.0
HTTPLoader.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <samchon/ByteArray.hpp>
5 #include <samchon/library/URLVariables.hpp>
6 
7 namespace samchon
8 {
9 namespace library
10 {
23  class SAMCHON_FRAMEWORK_API HTTPLoader
24  {
25  private:
26  std::string url;
27 
31  int method;
32 
37 
38  public:
39  enum METHOD : int
40  {
41  GET = 1,
42  POST = 2
43  };
44 
45  public:
46  /* ------------------------------------------------------------
47  CONSTRUCTORS
48  ------------------------------------------------------------ */
54  HTTPLoader(int method = POST);
55 
62  HTTPLoader(const std::string &, int method = POST);
63  virtual ~HTTPLoader() = default;
64 
65  /* ------------------------------------------------------------
66  SETTERS & GETTERS
67  ------------------------------------------------------------ */
71  void setURL(const std::string &);
72 
76  void setMethod(int);
77 
81  auto getURL() const->std::string;
82 
86  auto getMethod() const -> int;
87 
91  auto getCookie(const std::string &) const->std::string;
92 
93  /* ------------------------------------------------------------
94  LOADERS
95  ------------------------------------------------------------ */
104  auto load(const URLVariables & = {}) const->ByteArray;
105  };
106 };
107 };
A http, web-page loader.
Definition: HTTPLoader.hpp:23
static HashMap< std::string, std::string > cookieMap
Cookies got from remote web server.
Definition: HTTPLoader.hpp:36
int method
Method, Get or Post.
Definition: HTTPLoader.hpp:31
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7
URLVariables class is for representing variables of HTTP.