Announcement

Collapse
No announcement yet.

Looking for way to use HTTP Post to send info to my plugin

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

  • Looking for way to use HTTP Post to send info to my plugin

    (Newb plugin creator here, so maybe I'm missing something simple)

    I'm looking for a way to send information to my plugin via HTTP POST, similar to the way EgiGeoZone or Tasker can send info to PHLocation

    eg. https://{username}:{password}@connected2.homeseer.com/phlapi?dtype=CD&Type=TP&PHLID=%ID&loc=%LOC ...

    I can put a URL like this into a web browser and get a response from PHLocation.

    What maps the "phlapi" portion of the URL to the PHLocation plugin, and how does the plugin receive the parameters?

  • #2
    There are a couple of ways to achieve this, the simplest would be to 'register' a web page using the HS3 plug-in API and then handle the post back from that page. Its not perfect but it works ok. If you look at any of the 'config' pages from plug-ins then these are created this way. Alternatively you could handle the http transaction yourself from within the plug-in on a different port. Since its only HTTP POST then you've simply got to capture the post'ed data, decode and then return the applicable 200 to the post'er. You wouldn't need to spend ages on handling all the return codes, etc.

    Comment


    • #3
      Please do not write your own web server. Use an existing project that has a chance of being secure.

      Third option ion is to include an aspx page with your plugin. It can run and call you vĂ­a Hs.pluginfunction

      Comment


      • #4
        Going back and looking at PHLocation I realized that it is using its own web server and I don't want to go in that direction. So I'm working on an aspx file approach. I'm able to extract my parameters but am having difficulty communicating with the plugin. That will be the subject of another post and the topic is changing.

        Thanks for everyone's help.

        Comment


        • #5
          Originally posted by jayph View Post
          Going back and looking at PHLocation I realized that it is using its own web server and I don't want to go in that direction. So I'm working on an aspx file approach. I'm able to extract my parameters but am having difficulty communicating with the plugin. That will be the subject of another post and the topic is changing.

          Thanks for everyone's help.
          Responded to your other thread....

          Comment

          Working...
          X