HTTPServer/_GET.h
2019-03-03 20:41:41 -08:00

32 lines
761 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.requestProtocol());
response.setCode("200");
response.setText("OK");
response.setMimeType("text/html");
session->out << response.getResponse(data);
session->send();
return 0;
}
};
}
#endif