HTTPServer/_GET.h
2019-02-24 09:36:42 -08:00

31 lines
679 B
C++

#ifndef ___GET_h__
#define ___GET_h__
#include "Command.h"
#include "Session.h"
#include "Header.h"
#include "Response.h"
namespace http {
class _GET : public core::Command {
public:
int processCommand(std::string request, core::Session *session) override {
core::Header header(request);
std::string data = "<html><head></head><body><h1>This Is A Test</h1></body></html>";
core::Response response();
response.setProtocol(header.getProtocol());
response.setCode("200");
response.setText("OK");
response.setMimeType("text/html");
session->out << response.getOutput(data);
session->send();
}
};
}
#endif