Browse Source

Use uri builder to build the build url

changes/91/636791/1
Monty Taylor 3 months ago
parent
commit
00a92c15c8
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      zuul-preview/main.cc

+ 3
- 2
zuul-preview/main.cc View File

@@ -26,9 +26,10 @@ using namespace std;
26 26
 int main(int, char**)
27 27
 {
28 28
   web::http::client::http_client client("https://zuul.opendev.org");
29
+  auto uri = web::uri_builder("/api/tenant/openstack/build");
30
+  uri.append_path("75031cad206c4014ad7a3387091d15ab");
29 31
   auto response = client.request(
30
-    web::http::methods::GET,
31
-     "/api/tenant/openstack/build/75031cad206c4014ad7a3387091d15ab").get();
32
+    web::http::methods::GET, uri.to_string()).get();
32 33
   // body is a web::json::value
33 34
   auto body = response.extract_json().get();
34 35
   cout << response.status_code() << endl;

Loading…
Cancel
Save