Buffet: Phase 1 of GCD device registration workflow
Implemented the basic device registration workflow in buffet daemon.
Updated buffet_client to perform/test device registration:
Check for device registration:
buffet_client cr
Getting registered device information:
buffet_client di
Begin registration (with all default values):
buffet_client sr
Begin registration with custom parameters:
buffet_client sr "service_url=http://localhost/buffet&device_kind=coffeePot"
Finalize registration:
buffet_client fr 4/FsXprlpVsmPw6z7ro7aqU156Eh6V.0ktCYeVc3DwYEnp6UAPFm0GAey3PigI
BUG=chromium:363348
TEST=unit tests passed.
Change-Id: Id8a90b66fbdc366eaa9f62caa82a7cb0abc2e638
Reviewed-on: https://chromium-review.googlesource.com/195082
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/http_utils.h b/buffet/http_utils.h
index 91e12b5..2979ed3 100644
--- a/buffet/http_utils.h
+++ b/buffet/http_utils.h
@@ -37,12 +37,19 @@
const HeaderList& headers);
// Performs a simple GET request and returns the data as a string.
-std::string GetAsString(const std::string& url);
+std::string GetAsString(const std::string& url, const HeaderList& headers);
+inline std::string GetAsString(const std::string& url) {
+ return GetAsString(url, HeaderList());
+}
// Performs a GET request. Success status, returned data and additional
// information (such as returned HTTP headers) can be obtained from
// the returned Response object.
-std::unique_ptr<Response> Get(const std::string& url);
+std::unique_ptr<Response> Get(const std::string& url,
+ const HeaderList& headers);
+inline std::unique_ptr<Response> Get(const std::string& url) {
+ return Get(url, HeaderList());
+}
// Performs a HEAD request. Success status and additional
// information (such as returned HTTP headers) can be obtained from