public Inventory() { try { WebRequest InventoryInfoGET = WebRequest.Create("https://api.steampowered.com/ICSGOTournaments_730/GetTournamentItems/v1?key=" + Properties.Settings.Default.apiKey + Properties.Settings.Default.tournamentItems); InventoryInfoGET.ContentType = "application/json; charset=utf-8"; Stream inventoryStream = InventoryInfoGET.GetResponse().GetResponseStream(); StreamReader inventoryReader = new StreamReader(inventoryStream); StringBuilder sb = new StringBuilder(); while (inventoryReader.EndOfStream != true) { sb.Append(inventoryReader.ReadLine()); } inventoryJSON = sb.ToString(); deserializedInventoryResults = JsonConvert.DeserializeObject <Inventory_ResultWrapper>(inventoryJSON); } catch (Exception exc) { MessageBox.Show("ERROR PIRANNHA:\n\nThere was an issue retrieving inventory information: " + exc.ToString()); } }
public Inventory() { try { WebRequest InventoryInfoGET = WebRequest.Create("https://api.steampowered.com/ICSGOTournaments_730/GetTournamentItems/v1?key=" + Properties.Settings.Default.apiKey + Properties.Settings.Default.tournamentItems); InventoryInfoGET.ContentType = "application/json; charset=utf-8"; Stream inventoryStream = InventoryInfoGET.GetResponse().GetResponseStream(); StreamReader inventoryReader = new StreamReader(inventoryStream); StringBuilder sb = new StringBuilder(); while (inventoryReader.EndOfStream != true) { sb.Append(inventoryReader.ReadLine()); } inventoryJSON = sb.ToString(); deserializedInventoryResults = JsonConvert.DeserializeObject<Inventory_ResultWrapper>(inventoryJSON); } catch (Exception exc) { MessageBox.Show("ERROR PIRANNHA:\n\nThere was an issue retrieving inventory information: " + exc.ToString()); } }