1
0
forked from blue/pica
pica/response/response.h

35 lines
554 B
C
Raw Normal View History

2023-11-21 22:19:08 +00:00
#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;
};