http_request.hpp
1 #ifndef NOOS_CLOUD_HTTP_REQUEST
2 #define NOOS_CLOUD_HTTP_REQUEST
3 /*
4  * LICENSE HERE
5  */
6 #include "includes.ihh"
7 #include <boost/asio.hpp>
8 #include <noos/cloud/asio/http_header.hpp>
9 #include <noos/cloud/asio/http_post.hpp>
10 #include <noos/cloud/asio/platform.hpp>
11 namespace noos {
13 namespace cloud {
21 {
22 public:
24  http_request(const std::string uri);
25 
28  http_request(const std::string uri,
29  bool keep_alive);
30 
32  http_request(const http_request & arg);
33 
41  void fill_buffer(
42  boost::asio::streambuf & buffer,
44  );
45 
48  template <typename... Args>
49  void add_content(Args... args);
50 
53  void close();
54 
57  std::string to_string(noos::cloud::platform info) const;
58 
61  std::string to_post() const;
62 
64  bool operator==(const http_request & rhs) const;
65 
68  void make_multipart_form();
69 
70 private:
71  std::shared_ptr<noos::cloud::http_header> header_;
72  std::shared_ptr<noos::cloud::http_post> post_;
73 };
74 }
75 }
76 #include "http_request.tpl"
77 #endif
nooser for the classes http_header &http_post used for cloud requests
Definition: http_request.hpp:20
std::string to_post() const
translate post data into a string with HTTP Protocol format
void close()
close this request properly
bool operator==(const http_request &rhs) const
compare if two http_request are equal
data of the platform where you are going to connect
Definition: platform.hpp:23
Definition: asio_handler.hpp:14
void make_multipart_form()
make this a multipart-form, by creating the correct header fields, boundaries and multipart entries ...
std::string to_string(noos::cloud::platform info) const
translate noos::cloud::platform parameters into a string with HTTP Protocol format ...
http_request(const std::string uri)
construct a cloud HTTP request (multipart/form-data)
void add_content(Args...args)
add multiple content to the post with HTTP Protocol
void fill_buffer(boost::asio::streambuf &buffer, noos::cloud::platform info)
fill the socket streambuf with the request header and post data