HttpRequest.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include <Text.h>
  3. namespace Network
  4. {
  5. namespace HTTP
  6. {
  7. class Answer
  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. int ref;
  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 ) Answer *getThis();
  26. __declspec( dllexport ) Answer *release();
  27. };
  28. class PostRequest
  29. {
  30. private:
  31. Framework::Text path;
  32. Framework::Text host;
  33. Framework::Text contentType;
  34. Framework::Text data;
  35. unsigned short port;
  36. int ref;
  37. public:
  38. __declspec( dllexport ) PostRequest( const char *path, const char *host, const char *data, const char *contentType, unsigned short port );
  39. __declspec( dllexport ) Answer *execute() const;
  40. __declspec( dllexport ) PostRequest *getThis();
  41. __declspec( dllexport ) PostRequest *release();
  42. };
  43. }
  44. }