HTTP API Problems

I get this response: “status”: “timed_out” when using the C# HTTP client to Set State. Any ideas why this is happening? Thanks.

One more thing it seems to work fine using the older HttpWebRequest Class. But I am not able to use this class with the hardware I am writing this for. Thanks.

Nevermind I figured it out. The content portion of the Put was not being sent correctly.

How was it incorrect and how did you correct it? I seem to be having a similar issue

        static async void PowerOn()

        string selectorId = "Office";
        string url = "" + selectorId + "/state";
        string putData = "{\"power\": \"on\"}";

        HttpClient client = new HttpClient();
        client.DefaultRequestHeaders.Add("Application", "application/json");
        client.DefaultRequestHeaders.Add("Authorization", "Bearer c8ac9827f1406f965a79");


            var response = await client.PutAsync(url, new StringContent(putData, Encoding.UTF8, "application/json"));

            string result = await response.Content.ReadAsStringAsync();

        catch (Exception Ex)


I deleted most of the Bearer code FYI.

data = “{“power”: “off”}”
fixed my problem, thanks man!