HttpRequest.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. public:
  36. __declspec( dllexport ) PostRequest( const char *path, const char *host, const char *data, const char *contentType, unsigned short port );
  37. __declspec( dllexport ) Answer *execute() const;
  38. };
  39. }
  40. }