HttpRequest.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. Framework::Text all;
  18. int ref;
  19. public:
  20. __declspec( dllexport ) Answer( const char *answer );
  21. __declspec( dllexport ) const char *getContentType() const;
  22. __declspec( dllexport ) const char *getData() const;
  23. __declspec( dllexport ) int getStatusCode() const;
  24. __declspec( dllexport ) const char *getStatusText() const;
  25. __declspec( dllexport ) const char *getDate() const;
  26. __declspec( dllexport ) const char *getAll() const;
  27. __declspec( dllexport ) Answer *getThis();
  28. __declspec( dllexport ) Answer *release();
  29. };
  30. class PostRequest
  31. {
  32. private:
  33. Framework::Text path;
  34. Framework::Text host;
  35. Framework::Text contentType;
  36. Framework::Text data;
  37. unsigned short port;
  38. int ref;
  39. public:
  40. __declspec( dllexport ) PostRequest( const char *path, const char *host, const char *data, const char *contentType, unsigned short port );
  41. __declspec( dllexport ) Answer *execute() const;
  42. __declspec( dllexport ) PostRequest *getThis();
  43. __declspec( dllexport ) PostRequest *release();
  44. };
  45. }
  46. }