Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_TEST_SERVER_HTTP_RESPONSE_H_ | |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_TEST_SERVER_HTTP_RESPONSE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <map> | |
|
Lei Zhang
2012/11/14 05:30:07
nit: map before string, separate system headers wi
satorux1
2012/11/14 05:47:30
Done.
| |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 namespace drive { | |
| 13 namespace test_server { | |
| 14 | |
| 15 enum ResponseCode { | |
| 16 SUCCESS = 200, | |
| 17 MOVED = 301, | |
| 18 NOT_FOUND = 404, | |
| 19 ACCESS_DENIED = 500, | |
| 20 }; | |
| 21 | |
| 22 // Respresents a HTTP response. Since it can be big, it may be better to use | |
| 23 // scoped_ptr to pass it instead of copying. | |
| 24 struct HttpResponse { | |
|
Lei Zhang
2012/11/14 05:30:07
This should either be a class, or ToResponseString
satorux1
2012/11/14 05:47:30
Changed it to a class.
| |
| 25 HttpResponse(); | |
| 26 ~HttpResponse(); | |
| 27 | |
| 28 ResponseCode code; | |
| 29 std::string content; | |
| 30 std::string content_type; | |
| 31 std::map<std::string, std::string> custom_headers; | |
| 32 | |
| 33 // Generates and returns a http response string. | |
| 34 std::string ToResponseString() const; | |
| 35 }; | |
| 36 | |
| 37 } // namespace test_servers | |
| 38 } // namespace drive | |
| 39 | |
| 40 #endif // CHROME_BROWSER_GOOGLE_APIS_TEST_SERVER_HTTP_RESPONSE_H_ | |
| OLD | NEW |