How to use http in node with several parameters

Hi everyone,

since I lost all my flows in the docker container I have to rebuilt my home automation.

So far I've used the http in node to control my shelly swichtes.

My react dashboard call urls wich where build by the action to do (Set oder Get), the name of the room (for example kitchen) and the state to set (On or Off). For example http://192.168.188.70:1880/shelly/Set&Kitchen&On

But I can't figure out again how to configure the http in node. With that configuration

[
    {
        "id": "f65d86d5.e3d478",
        "type": "http in",
        "z": "cc03d791.a8b028",
        "name": "",
        "url": "/shelly/:Action:Light:State",
        "method": "get",
        "upload": false,
        "swaggerDoc": "",
        "x": 260,
        "y": 840,
        "wires": [
            [
                "bca62e3b.f4533",
                "e268532b.d8a52"
            ]
        ]
    }
]

the response is

{
"Action": "S",
"Light": "e",
"State": "t&Kitchen&On"
}

while I would expect

{
"Action": "Set",
"Light": "Kitchen",
"State": "On"
}

Can please anybody help how to set url in the configuration of the node?
Regards,
Lennart

Your url http://192.168.188.70:1880/shelly/Set&Kitchen&On
the in node is set to "/shelly/:Action:Light:State",
but should be "shelly/:Action/:Light/:State"

so your url should be http://192.168.188.70:1880/shelly/Set/Kitchen/On

eg.

[{"id":"299b0982.a981d6","type":"http in","z":"baae6393.f4a898","name":"","url":"/shelly/:Action/:Light/:State","method":"get","upload":false,"swaggerDoc":"","x":760,"y":460,"wires":[["6fca747f.8d8764","f0c4094.b9ff278"]]},{"id":"f0c4094.b9ff278","type":"http response","z":"baae6393.f4a898","name":"","statusCode":"","headers":{},"x":1040,"y":540,"wires":[]},{"id":"6fca747f.8d8764","type":"debug","z":"baae6393.f4a898","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"req.params","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":460,"wires":[]}]

thank you so much

that will work for me. So far, I'm using & as separator in my react coding. But I will replace it with / in the fetch function and everything will work fine then :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.