Receive content update notifications and new demo scripts by signing up for the newsletter using the form below.
Buy Me A Coffee
if you find this useful and would like to make a contribution, then you can do so by clicking here.
Click to rate this post!
[Total: 0 Average: 0]
5 comments
Thanks, Steve, I had modelled this in postman initially and expected it to work the same in nodered. In postman, the json body is also sent in a get request. I set the body to specify parameters for the get (.ie like an optional filename). I have changed it to post now in node-red and it works.
Do you have any examples of how to post json data?
In a change node I set msg.payload = { “fileName” : “noderedrequest.jpg” }
and
msg.headers.content-type = application/json
and
msg.method = get
But the json never appears in the packet when I inspect it with wireshark
I have the request node set to
– set by msg method
Thanks, Steve, I had modelled this in postman initially and expected it to work the same in nodered. In postman, the json body is also sent in a get request. I set the body to specify parameters for the get (.ie like an optional filename). I have changed it to post now in node-red and it works.
Good news
It seems the issue was that I had the method set to get. If the method is get the the httprequest node just ignores the payload.
Do you have any examples of how to post json data?
In a change node I set msg.payload = { “fileName” : “noderedrequest.jpg” }
and
msg.headers.content-type = application/json
and
msg.method = get
But the json never appears in the packet when I inspect it with wireshark
I have the request node set to
– set by msg method
You say post but the method you use is get?
Can you post me the flow or section of the flow you are using and I will take a look.
Rgds
Steve