using System.Collections;
using System.Collections.Generic;
public List<string> toppings
public static void Main()
List<Pizza> pizzas = ReadPizzas();
string json = new System.Net.WebClient().DownloadString("http://files.olo.com/pizzas.json");
public static List<Pizza> ReadPizzas()
string url = "http://files.olo.com/pizzas.json";
HttpWebRequest httpWebRequest = System.Net.WebRequest.Create(url) as HttpWebRequest;
using (HttpWebResponse httpWebResponse = httpWebRequest.GetResponse() as HttpWebResponse)
if (httpWebResponse.StatusCode != HttpStatusCode.OK)
throw new Exception(string.Format("Server error (HTTP {0}: {1}).", httpWebResponse.StatusCode, httpWebResponse.StatusDescription));
Stream stream = httpWebResponse.GetResponseStream();
string json = new StreamReader(stream).ReadToEnd();
pizzas = JsonConvert.DeserializeObject<List<Pizza>>(json);