+string HTTPMessage::reason(unsigned code) {
+ switch (code) {
+ // TODO completar los códigos.
+ case OK:
+ return "OK";
+ case BAD_REQUEST:
+ return "Bad Request";
+ case NOT_FOUND:
+ return "Not Found";
+ case LENGTH_REQUIRED:
+ return "Length Required";
+ case INTERNAL_SERVER_ERROR:
+ return "Internal Server Error";
+ case NOT_IMPLEMENTED:
+ return "Not Implemented";
+ case HTTP_VERSION_NOT_SUPPORTED:
+ return "HTTP Version Not Supported";
+ default:
+ return "No Reason";
+ }
+}
+