Announcement

Collapse
No announcement yet.

Making an HTTP Request from a script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Making an HTTP Request from a script

    Can anyone point me towards any examples of making an HTTP request and getting a JSON response from a script?
    "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

    #2
    Look in hshelp.pdf which is the HS3 user document that applies to hs4 as well. In particular look at hs.geturl method to get data from web sources. The json response can be parsed directly or one can use the library Newtonsoft. As a note, mcsMQTT takes care of much of the details if you want to use plug-in rather than script. Both are free solutions with direction dependent upon the level of interaction you desire.

    Comment


      #3
      Thank You Michael! I searched and searched but did not think to look at the HS3 documentation. hs.URLAction is exactly what I was looking for. I'm using your plugin for initial testing and also Node-RED for dissecting payloads, but in the end, the code has to be in a .vben format encrypted with HSSEncoder. The API for the product is not published and is therefore covered by an NDA. Local authentication is done using a JWT token so no internet connection is required for local control. JSON payloads are encrypted using that token.

      At some point this should probably be rolled up into a plug-in.

      Thanks Again,
      Ken
      "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

      Comment

      Working...
      X