http_status_code.cc
1 // Copyright 2013, Beeri 15. All rights reserved.
2 // Author: Roman Gershman (romange@gmail.com)
3 //
4 #include "http_status_code.h"
5 #include "base/logging.h"
6 
7 namespace http {
8 
9 const char* StatusStringFromCode(HttpStatusCode code) {
10  switch (code) {
11  case HTTP_OK: return "200 OK";
12  case HTTP_ACCEPTED: return"202 Accepted";
13  case HTTP_NO_CONTENT: return"204 No Content";
14  case HTTP_BAD_REQUEST: return "400 Bad Request";
15  case HTTP_UNAUTHORIZED: return "401 Unauthorized";
16  case HTTP_FORBIDDEN: return "403 Forbidden";
17  case HTTP_NOT_FOUND: return "404 Not Found";
18  default:
19  LOG(FATAL) << "Not implemented " << code;
20  }
21  return nullptr;
22 }
23 } // namespace http