Hi there,
I can't seem to figure out the errors I'm getting when trying to do an HTTP PUT to a website. I've pretty much followed the examples I've seen online. Do I not have something installed on my HS3 Zee 2 that I need to run this? I suppose I can just call a curl command but I would prefer to use native code to do this. Any thoughts?
Thanks, Chris
When I manually run this, I get the following logs:
I can't seem to figure out the errors I'm getting when trying to do an HTTP PUT to a website. I've pretty much followed the examples I've seen online. Do I not have something installed on my HS3 Zee 2 that I need to run this? I suppose I can just call a curl command but I would prefer to use native code to do this. Any thoughts?
Thanks, Chris
Code:
IMPORTS System.IO IMPORTS System.Net Sub Main(Parm As Object) Dim httpWebRequest = DirectCast(WebRequest.Create("http://192.168.1.50:3000/state/circuit/toggleState"), HttpWebRequest) httpWebRequest.ContentType = "application/json" httpWebRequest.Method = "PUT" Using streamWriter = New StreamWriter(httpWebRequest.GetRequestStream().ToString) Dim json As String = "{""id"" : ""3""}" streamWriter.Write(json) End Using Dim httpResponse = DirectCast(HttpWebRequest.GetResponse(), HttpWebResponse) Using streamReader = New StreamReader(httpResponse.GetResponseStream().ToString) Dim responseText = StreanReader.ReadToEnd() hs.WriteLog("Response", responseText) End Using End Sub
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: 'End Namespace' must be preceded by a matching 'Namespace'. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Identifier expected. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Expected 'End'. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: Expected 'End'. |
Sep-07 5:35:52 PM | Error | Compiling script /usr/local/HomeSeer/scripts/back_ll_on.vb: End of statement expected. |
Comment