Why in node-red my HTTP POST no receive payload from inject?


Why in node-red my HTTP POST no receive payload from inject?



i try use
https://rpinotify.it/invio-di-testo.html
i want send message with http post but i can't, see images



i use Node-Red to fred.sensetecnic, i try use json, strings... i can't undestrand, can you help me?


3/7/2018, 08:43:15node: 9ee1f8ea.e1c5b8
msg.payload : Object
object
text: "testo"
3/7/2018, 08:43:15node: 9ee1f8ea.e1c5b8
msg.payload : Object
object
info: object
datetime: "2018-07-03 06:43:15"
ip: "54.149.86.44, 108.162.246.239"
message: "'text' or 'img' POST parameter are required"
response: 400



enter link description here



enter link description here



enter link description here


[
{
"id": "e6ce432b.5361",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": ""
},
{
"id": "1b6aa9ad.127af6",
"type": "inject",
"z": "e6ce432b.5361",
"name": "",
"topic": "",
"payload": "{"text":"testo"}",
"payloadType": "json",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 130,
"y": 420,
"wires": [
[
"18f17e07.1a0c42",
"9ee1f8ea.e1c5b8"
]
]
},
{
"id": "18f17e07.1a0c42",
"type": "http request",
"z": "e6ce432b.5361",
"name": "",
"method": "POST",
"ret": "obj",
"url": "https://api.rpinotify.it/message/xxx__secret_key__xxx/",
"tls": "",
"x": 370,
"y": 480,
"wires": [
[
"9ee1f8ea.e1c5b8"
]
]
},
{
"id": "9ee1f8ea.e1c5b8",
"type": "debug",
"z": "e6ce432b.5361",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 550,
"y": 380,
"wires":
}
]





What images? Please update your post with a screen capture of the debug sidebar, showing your payload expanded so we can see the structure of the data you are sending. It would also help to know what node you are trying to use -- you mentioned "http post", but the RpiNotify site says it uses telegram.
– SteveR
Jul 2 at 17:12




1 Answer
1



If you are sending a msg.payload of {} that is an empty object.


{}



The error is saying you need to have a text or a img field in the object (with a sensible value)


text


img





no, my msg.payload is text: "message"
– Enrico Sartori
Jul 3 at 6:31






thanks, i add images and node-red code
– Enrico Sartori
Jul 3 at 6:45






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

PHP contact form sending but not receiving emails

PHP parse/syntax errors; and how to solve them?