HttpRequest.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <Text.h>
  3. namespace Network
  4. {
  5. namespace HTTP
  6. {
  7. class Answer : public virtual Framework::ReferenceCounter
  8. {
  9. private:
  10. Framework::Text protocol;
  11. int statusNumber;
  12. Framework::Text statusText;
  13. Framework::Text date;
  14. Framework::Text contentType;
  15. Framework::Text header;
  16. Framework::Text data;
  17. Framework::Text all;
  18. public:
  19. __declspec(dllexport) Answer(const char* answer);
  20. __declspec(dllexport) const char* getContentType() const;
  21. __declspec(dllexport) const char* getData() const;
  22. __declspec(dllexport) int getStatusCode() const;
  23. __declspec(dllexport) const char* getStatusText() const;
  24. __declspec(dllexport) const char* getDate() const;
  25. __declspec(dllexport) const char* getAll() const;
  26. };
  27. class PostRequest : public virtual Framework::ReferenceCounter
  28. {
  29. private:
  30. Framework::Text path;
  31. Framework::Text host;
  32. Framework::Text contentType;
  33. Framework::Text data;
  34. unsigned short port;
  35. bool useSSL;
  36. public:
  37. __declspec(dllexport) PostRequest(const char* path,
  38. const char* host,
  39. const char* data,
  40. const char* contentType,
  41. unsigned short port,
  42. bool useSSL = false);
  43. __declspec(dllexport) Answer* execute() const;
  44. };
  45. } // namespace HTTP
  46. } // namespace Network