2023-08-21 14:22:41 +08:00
|
|
|
#ifndef __RESPONSE_H__
|
|
|
|
|
#define __RESPONSE_H__
|
|
|
|
|
#include "string"
|
|
|
|
|
#include <string>
|
|
|
|
|
namespace Req {
|
|
|
|
|
class Response
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Response();
|
2023-08-22 10:47:19 +08:00
|
|
|
static Response* ErrorResponse(const std::string & content);
|
2023-08-21 14:22:41 +08:00
|
|
|
Response(Response &&) = default;
|
|
|
|
|
Response(const Response &) = default;
|
|
|
|
|
Response &operator=(Response &&) = delete;
|
|
|
|
|
Response &operator=(const Response &) = delete;
|
|
|
|
|
~Response();
|
|
|
|
|
long httpCode();
|
|
|
|
|
void setHttpCode(long code);
|
|
|
|
|
std::string& getContent();
|
2023-08-22 10:47:19 +08:00
|
|
|
bool isResponsed();
|
2023-08-21 14:22:41 +08:00
|
|
|
private:
|
|
|
|
|
long mHttpCode = 404;
|
|
|
|
|
std::string mContent;
|
2023-08-22 10:47:19 +08:00
|
|
|
bool mResponsed;
|
2023-08-21 14:22:41 +08:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
#endif // __RESPONSE_H__
|