Use restclient to load a zuul build

This commit is contained in:
James E. Blair 2019-02-09 08:46:59 -08:00
parent 1dbacebd70
commit 0101e1cd39
1 changed files with 5 additions and 7 deletions

View File

@ -18,22 +18,20 @@
*/ */
#include <config.h> #include <config.h>
#include <pthread.h> #include <pthread.h>
#include <json.hpp> #include <json.hpp>
#include <restclient-cpp/restclient.h>
// for convenience // for convenience
using json = nlohmann::json; using json = nlohmann::json;
using namespace std; using namespace std;
int main(int, char**) int main(int, char**)
{ {
json j;
j["pi"] = 3.14; RestClient::Response r = RestClient::get("http://zuul.opendev.org/api/tenant/openstack/build/75031cad206c4014ad7a3387091d15ab");
j["happy"] = true;
json j = json::parse(r.body);
cout << j.dump(4) << endl; cout << j.dump(4) << endl;
} }