@Steve-Mcl Hi,
I have seen you explanation in another post and created a similar function as shown below. But it shows an error says that header is not defined.
[
{
"id": "f5f002edd615ee59",
"type": "http request",
"z": "c4c83788d56b12ab",
"name": "",
"method": "use",
"ret": "obj",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"x": 730,
"y": 720,
"wires": [
[]
]
},
{
"id": "7ae690eff112b561",
"type": "inject",
"z": "c4c83788d56b12ab",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 160,
"y": 720,
"wires": [
[
"17809da405f22d1d"
]
]
},
{
"id": "17809da405f22d1d",
"type": "function",
"z": "c4c83788d56b12ab",
"name": "",
"func": "headers[\"Content-Type\"] = \"application/json\"\nmsg.method = \"POST\"\nmsg.headers = headers\nmsg.url = \"http://ip-adress:8100/order\"\nmsg.payload = {\"id\": 1000000100000000000,\"action\":[{\"action\":\"drive\",\"target\":{\"coordinate\":[{\n \"x\": 48.125,\n \"y\": 95.461,\n \"angle\": 0\n }]\n}\n}]\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 440,
"y": 720,
"wires": [
[
"f5f002edd615ee59"
]
]
}
]