35 lines
554 B
C
35 lines
554 B
C
|
#pragma once
|
||
|
|
||
|
#include <string>
|
||
|
#include <array>
|
||
|
#include <string_view>
|
||
|
|
||
|
#include "request/request.h"
|
||
|
#include "stream/ostream.h"
|
||
|
|
||
|
class Response {
|
||
|
public:
|
||
|
enum class Status {
|
||
|
ok,
|
||
|
notFound,
|
||
|
methodNotAllowed,
|
||
|
internalError,
|
||
|
__size
|
||
|
};
|
||
|
|
||
|
enum class ContentType {
|
||
|
text,
|
||
|
__size
|
||
|
};
|
||
|
Response();
|
||
|
Response(Status status);
|
||
|
|
||
|
void replyTo(Request& request) const;
|
||
|
void setBody(const std::string& body);
|
||
|
|
||
|
private:
|
||
|
Status status;
|
||
|
ContentType type;
|
||
|
std::string body;
|
||
|
};
|