# Response header 'success'

**URL:** https://discourse.nodered.org/t/response-header-success/51434
**Category:** General
**Created:** [23 September 2021 10:29 UTC](https://discourse.nodered.org/t/response-header-success/51434 "2021-09-23T10:29:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ketpa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ketpa/32/42496_2.png) [@ketpa](https://discourse.nodered.org/u/ketpa)
#### Post date: [23 September 2021 10:29 UTC](https://discourse.nodered.org/t/response-header-success/51434/1 "2021-09-23T10:29:28Z")

</div>

I have that situation ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a1243ccd33aee5542b025f88ba0986a1ad7f068f.png)  
Node-red is a Server, and I have to create response with header  
 ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a27bc5c23d8d80bb3f48cdf05db10f5ad106495f.png)  
I created `[{"id":"d44b102d.310108","type":"http in","z":"15ff44a1.77852b","name":"","url":"/czujnik","method":"post","upload":false,"swaggerDoc":"","x":70,"y":700,"wires":[["800c842a.ebeb98","f1699fcf.c4d48"]]},{"id":"800c842a.ebeb98","type":"debug","z":"15ff44a1.77852b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":330,"y":640,"wires":[]},{"id":"f1699fcf.c4d48","type":"function","z":"15ff44a1.77852b","name":"postRecordedData","func":"msg.payload = \"postRecordedData\";\nmsg.headers = {};\n//msg.headers= ['HTTP/1.1 200 Success'];\nmsg.headers['statusCode']='200';\nmsg.headers['Server']='100.0.0.75';\nmsg.headers['Content-Type']='application/octet-stream';\nmsg.headers['Content-Length']='0';\nmsg.headers['Connection']='keep-alive';\nmsg.headers['X-Content-Type-Options']='nosniff';\nmsg.headers['X-Tandd-Next-Command']='none';\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":700,"wires":[["8e6f0a5e.09d12"]]},{"id":"8e6f0a5e.09d12","type":"http request","z":"15ff44a1.77852b","name":"","method":"POST","ret":"obj","paytoqs":"ignore","url":"10.0.0.100","tls":"","persist":false,"proxy":"","authType":"","x":510,"y":700,"wires":[["215069b1.e963f6"]]},{"id":"215069b1.e963f6","type":"debug","z":"15ff44a1.77852b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":700,"wires":[]}]`

 ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8ab59111e278a029beb4718dbb5ab9dafec82f95.png)  
PostRecordedData is:

```auto
msg.payload = "postRecordedData";
msg.headers = {};
msg.headers['statusCode']='200';
msg.headers['Server']='100.0.0.75';
msg.headers['Content-Type']='application/octet-stream';
msg.headers['Content-Length']='0';
msg.headers['Connection']='keep-alive';
msg.headers['X-Content-Type-Options']='nosniff';
msg.headers['X-Tandd-Next-Command']='none';

return msg;

```

What's wrong, because I have message from Base Unit that not success

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [23 September 2021 11:01 UTC](https://discourse.nodered.org/t/response-header-success/51434/2 "2021-09-23T11:01:04Z")

</div>

You currently have an HTTP Request node in your flow. That is used to send http requests to a server.

In this case, you are trying to respond to an HTTP Request that has been received by the HTTP In node. You should use the HTTP Response node to do that.

---

<div class="post-metadata">

### Author: ![ketpa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ketpa/32/42496_2.png) [@ketpa](https://discourse.nodered.org/u/ketpa)
#### Post date: [23 September 2021 11:38 UTC](https://discourse.nodered.org/t/response-header-success/51434/3 "2021-09-23T11:38:16Z")

</div>

like that?  
 ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2b06fe87d65f397c92e041260bf795ae5f22ce8b.png)  
 ![obraz](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/5009a7d2e72c6304d2b091231f2d8c71a0ea2d07.png)

but the same information about not succes in Base Unit

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [22 November 2021 11:38 UTC](https://discourse.nodered.org/t/response-header-success/51434/4 "2021-11-22T11:38:42Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
