OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ | 5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ |
6 #define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ | 6 #define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Represents a HTTP request. Since it can be big, use scoped_ptr to pass it | 29 // Represents a HTTP request. Since it can be big, use scoped_ptr to pass it |
30 // instead of copying. However, the struct is copyable so tests can save and | 30 // instead of copying. However, the struct is copyable so tests can save and |
31 // examine a HTTP request. | 31 // examine a HTTP request. |
32 struct HttpRequest { | 32 struct HttpRequest { |
33 HttpRequest(); | 33 HttpRequest(); |
34 ~HttpRequest(); | 34 ~HttpRequest(); |
35 | 35 |
36 std::string relative_url; // Starts with '/'. Example: "/test?query=foo" | 36 std::string relative_url; // Starts with '/'. Example: "/test?query=foo" |
37 HttpMethod method; | 37 HttpMethod method; |
38 std::string method_string; | 38 std::string method_string; |
| 39 std::string all_headers; |
39 std::map<std::string, std::string> headers; | 40 std::map<std::string, std::string> headers; |
40 std::string content; | 41 std::string content; |
41 bool has_content; | 42 bool has_content; |
42 }; | 43 }; |
43 | 44 |
44 // Parses the input data and produces a valid HttpRequest object. If there is | 45 // Parses the input data and produces a valid HttpRequest object. If there is |
45 // more than one request in one chunk, then only the first one will be parsed. | 46 // more than one request in one chunk, then only the first one will be parsed. |
46 // The common use is as below: | 47 // The common use is as below: |
47 // HttpRequestParser parser; | 48 // HttpRequestParser parser; |
48 // (...) | 49 // (...) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Content length of the request currently being parsed. | 108 // Content length of the request currently being parsed. |
108 size_t declared_content_length_; | 109 size_t declared_content_length_; |
109 | 110 |
110 DISALLOW_COPY_AND_ASSIGN(HttpRequestParser); | 111 DISALLOW_COPY_AND_ASSIGN(HttpRequestParser); |
111 }; | 112 }; |
112 | 113 |
113 } // namespace test_server | 114 } // namespace test_server |
114 } // namespace net | 115 } // namespace net |
115 | 116 |
116 #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ | 117 #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ |
OLD | NEW |