HttpRequest.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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, const char *host, const char *data, const char *contentType, unsigned short port, bool useSSL = false );
  38. __declspec( dllexport ) Answer *execute() const;
  39. };
  40. }
  41. }