Ejemplo n.º 1
0
        private static async Task GetRecipes(string recipe)
        {
            //This is how I have set up calls to the RestApp
            //PARAMS: string method, string query
            Response response = await RestApp.Request("GET", recipe);

            //serialize the response to a string
            string jsonResponse = await response.Content.ReadAsStringAsync();

            //Create a JObject from the string jsonResponse
            JObject recipes = JObject.Parse(jsonResponse);

            //Create a JArray from a key element in the JSON(hits)
            //hits is a JSON Array of objects hence, the need to convert the JObject into an Array
            JArray recipeArr = JArray.Parse(recipes["hits"].ToString());


            //Loop through all of the objects found in recipes["hits"]
            for (var i = 0; i < recipeArr.Count(); ++i)
            {
                //Due to our set toLimit in the RestRequest application we will at maximum only get 25 recipes back.
                recipeList.Add(recipeArr[i]["recipe"]["label"].ToString());
            }
        }
Ejemplo n.º 2
0
 public DeploymentDAO(RestApp restApp)
 {
     this.restApp = restApp;
 }
Ejemplo n.º 3
0
 public TaskDAO(RestApp restApp)
 {
     this.restApp = restApp;
 }
Ejemplo n.º 4
0
 public FormDAO(RestApp restApp)
 {
     this.restApp = restApp;
 }
Ejemplo n.º 5
0
 public ProcessDAO(RestApp restApp)
 {
     this.restApp = restApp;
 }