1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_SERVER_HTTP_SERVER_REQUEST_INFO_H_ 6 #define NET_SERVER_HTTP_SERVER_REQUEST_INFO_H_ 7 8 #include <map> 9 #include <string> 10 11 namespace net { 12 13 // Meta information about an HTTP request. 14 // This is geared toward servers in that it keeps a map of the headers and 15 // values rather than just a list of header strings (which net::HttpRequestInfo 16 // does). 17 class HttpServerRequestInfo { 18 public: 19 HttpServerRequestInfo(); 20 ~HttpServerRequestInfo(); 21 22 // Returns header value for given header name. |header_name| should be 23 // lower case. 24 std::string GetHeaderValue(const std::string& header_name) const; 25 26 // Request method. 27 std::string method; 28 29 // Request line. 30 std::string path; 31 32 // Request data. 33 std::string data; 34 35 // A map of the names -> values for HTTP headers. These should always 36 // contain lower case field names. 37 typedef std::map<std::string, std::string> HeadersMap; 38 mutable HeadersMap headers; 39 }; 40 41 } // namespace net 42 43 #endif // NET_SERVER_HTTP_SERVER_REQUEST_INFO_H_ 44