a simple multithreaded webserver
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
579 B

  1. #pragma once
  2. #include <string>
  3. #include <stdexcept>
  4. namespace pEp
  5. {
  6. class HttpError : public std::runtime_error
  7. {
  8. public:
  9. HttpError(unsigned error_code, const std::string& error_message);
  10. };
  11. class Webclient
  12. {
  13. public:
  14. Webclient(const std::string& server_name, unsigned port=80)
  15. : m_server_name{server_name}
  16. , m_port{port}
  17. {}
  18. std::string get(const std::string& url);
  19. private:
  20. const std::string& m_server_name;
  21. const unsigned m_port;
  22. };
  23. } // end of namespace pEp