HayatoKamonoさんのご指摘通り、そもそも想定されているリクエストが正しくnode-red上に届いていますか?
コード的には問題なく、私のnode-red上では想定されている分岐を行っておりました.
node-redコード
[{"id":"30556f3d.b8414","type":"http in","z":"741556a5.704a88","name":"","url":"/sample","method":"post","upload":false,"swaggerDoc":"","x":110,"y":40,"wires":[["6a13a79f.e59ec8","4193f835.713e78"]]},{"id":"6a13a79f.e59ec8","type":"function","z":"741556a5.704a88","name":"チェック","func":"if (typeof msg.payload.department_id === 'undefined') {\n msg.flg = '0'; // 規定値の代入\n}else{\n msg.department_id = msg.payload.department_id;\n msg.flg = '1'; // 規定値の代入\n}\nreturn msg;","outputs":1,"noerr":0,"x":100,"y":120,"wires":[["e9a76a0f.8f6188","195f1914.a90207","bb9152b6.957a1"]]},{"id":"4193f835.713e78","type":"debug","z":"741556a5.704a88","name":"","active":true,"console":"false","complete":"false","x":296,"y":46,"wires":[]},{"id":"e9a76a0f.8f6188","type":"http response","z":"741556a5.704a88","name":"","statusCode":"","headers":{},"x":90,"y":200,"wires":[]},{"id":"195f1914.a90207","type":"debug","z":"741556a5.704a88","name":"","active":true,"console":"false","complete":"flg","x":300,"y":120,"wires":[]},{"id":"bb9152b6.957a1","type":"debug","z":"741556a5.704a88","name":"","active":true,"console":"false","complete":"department_id","x":330,"y":160,"wires":[]}]
windowsでcurlを実行
curl -H "Content-Type:application/json" -X POST -d "{\"userid\":\"255\",\"list_flg\":\"0\",\"department_id\":\"1\"}" https://<URL>/sample
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/03/16 08:59