• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    http post

    Scheduled Pinned Locked Moved Node-RED
    3 Posts 1 Posters 1.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      juntiedt
      last edited by

      Hi, I am able to post a bulk request with this function node:

      msg.url = "http://10.0.0.52:8080/bulk";
      msg.headers =JSON.stringify({"content-type":"application/json"});
      msg.payload = JSON.stringify({"group_queries": [{"device_types": ["temp"]}]});
      return msg;
      

      in oder to get all 1-wire sensors.

      But I have problems to write the code for setting relay 5 to on (post) or to write the code for getting the status of relay 5 (get).
      Would very much appreciate your help in this case.

      1 Reply Last reply
      Reply Quote 0
      • J
        juntiedt
        last edited by

        solved it!

        msg.url = "http://10.0.0.52:8080/json/relay/3";
        msg.headers =JSON.stringify({"content-type":"application/json"});
        msg.payload = JSON.stringify({"value": "1","timeout": "20"});
        return msg;
        
        1 Reply Last reply
        Reply Quote 0
        • J
          juntiedt
          last edited by

          this works as well:

          msg.url = "http://10.0.0.52:8080/json/relay/3";
          msg.headers ='({"content-type":"application/json"})';
          msg.payload = '({"value": "1","timeout": "20"})';
          return msg;
          
          1 Reply Last reply
          Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post