private void button1_Click(object sender, EventArgs e) { charName = textBoxAcc.Text; new Thread(() => { Thread.CurrentThread.IsBackground = true; PublicStash.fillRootObjects(charStash, textBoxAcc.Text, PublicStash.GetLatestId()); }).Start(); }
public static string getPublicJSON(string next_change_id = null) { string jsonRequest = @"http://www.pathofexile.com/api/public-stash-tabs"; string result = ""; if (next_change_id == null) { next_change_id = PublicStash.GetLatestId(); } Debug.WriteLine("Getting " + next_change_id); jsonRequest += "?id=" + next_change_id; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(jsonRequest); WebResponse response = request.GetResponse(); using (Stream responseStream = response.GetResponseStream()) { StreamReader reader = new StreamReader(responseStream); result = reader.ReadToEnd(); reader.Close(); } return(result); }