make_form.h 729 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "http_define.h"
  3. #if USE_NET_HTTP_UTIL
  4. #include "util/vector.hpp"
  5. namespace ylib
  6. {
  7. namespace network
  8. {
  9. namespace http
  10. {
  11. class make_form
  12. {
  13. public:
  14. make_form();
  15. ~make_form();
  16. bool add(const std::string& name, const std::string& value);
  17. bool add(const std::string& name, const std::string& filename, const std::string& content_type, const ylib::buffer& data);
  18. bool make(ylib::buffer& data, std::string& boundary) const;
  19. private:
  20. ylib::vector<form_info*> m_list;
  21. ylib::buffer m_data;
  22. };
  23. }
  24. }
  25. }
  26. #endif