I’m trying to write a library in C# to communicate with the Spark Cloud. So far so good with everything except for deleting old access tokens. I can list token fine, but when I use the DELETE method with the same ID/password combo my request times out.
Here’s the code I’m using:
WebClient wc = new WebClient(); wc.Headers[HttpRequestHeader.Authorization] = "Basic " + encodeCreds(id, pw); string retval = wc.UploadString(temp_url, "DELETE", "");
WebRequest wr = WebRequest.Create(temp_url); wr.Headers.Add("Authorization", "Basic " + encodeCreds(id, pw)); wr.Method = "DELETE"; HttpWebResponse res = (HttpWebResponse)wr.GetResponse();
I’m a webdev by day but I’ve not had much experience with the DELETE method, so any help would be greatly appreciated.