Add query parameters to RestService::Handle()

This commit is contained in:
Adam Gu
2018-04-23 13:22:59 +08:00
parent f921256a33
commit bcfb1e4c92
5 changed files with 17 additions and 2 deletions
@@ -117,6 +117,7 @@ static bool BookFromJson(const std::string& json, Book* book) {
bool BookListService::Handle(const std::string& http_method,
const std::vector<std::string>& url_sub_matches,
const std::map<std::string, std::string>& query,
const std::string& request_content,
std::string* response_content) {
if (http_method == webcc::kHttpGet) {
@@ -149,6 +150,7 @@ bool BookListService::Handle(const std::string& http_method,
bool BookDetailService::Handle(const std::string& http_method,
const std::vector<std::string>& url_sub_matches,
const std::map<std::string, std::string>& query,
const std::string& request_content,
std::string* response_content) {
if (url_sub_matches.size() != 1) {
+2
View File
@@ -22,6 +22,7 @@ public:
bool Handle(const std::string& http_method,
const std::vector<std::string>& url_sub_matches,
const std::map<std::string, std::string>& query,
const std::string& request_content,
std::string* response_content) override;
};
@@ -41,6 +42,7 @@ public:
bool Handle(const std::string& http_method,
const std::vector<std::string>& url_sub_matches,
const std::map<std::string, std::string>& query,
const std::string& request_content,
std::string* response_content) override;
};