Setting status code 204 in http reposne

512 views
Skip to first unread message

Abhishek Anne

unread,
Apr 21, 2017, 8:17:45 AM4/21/17
to Node-RED
Hi,

I want to send response code as 204 ie Success - with no further content

I try to set :

// This code inside  function node before HTTP response node
   
msg.headers = { 'Status Code': 204 };  

//Explicitly making body empty
msg.payload='';
return msg;

Though I am getting error "TypeError: Header name must be a valid HTTP Token ["Status Code"]"

Please suggest

Thank You.

Nick O'Leary

unread,
Apr 21, 2017, 8:29:07 AM4/21/17
to Node-RED

The info tab for the http response node tells you how to set the status code of the response... It isn't via msg.headers.

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/1bc380ca-1877-411a-8cc0-bc95110d5347%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Abhishek Anne

unread,
Apr 21, 2017, 8:46:23 AM4/21/17
to Node-RED
Thank you very much Nick !! That helped.
Reply all
Reply to author
Forward
0 new messages