# "No response object"

**URL:** <https://discourse.nodered.org/t/no-response-object/51461>\
**Category:** General\
**Tags:** http-request\
**Created:** [24 September 2021 05:16 UTC](https://discourse.nodered.org/t/no-response-object/51461 "2021-09-24T05:16:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 05:16 UTC](https://discourse.nodered.org/t/no-response-object/51461/1 "2021-09-24T05:16:07Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98efa9fca66ae4224f1d0c06d96c30b5a6e6c6ff.png)

Hi there,  
I wanted to post the prediction value from python to template node but it says "No response object". Whenever I am trying to post, the python code take time to run and thus its not getting the value in template node. I even tried to add delay in function node but not working. Please anyone can help.

Thank you!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 05:41 UTC](https://discourse.nodered.org/t/no-response-object/51461/2 "2021-09-24T05:41:46Z")

</div>

The http in node emits a msg with 2 special properties `.req`& `.res`

The original msg with these 2 properties MUST travel through your flow all the way to the http response node.

This is so it know how to reply.

One of your nodes is NOT returning the original msg & you are losing .req and .res

Use debug nodes on every node (set to show full msg object) you will see where they get dropped.

My money is on the python shell node.

Another reason to convert you image inside node-red (like I showed you in the other thread)

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 05:48 UTC](https://discourse.nodered.org/t/no-response-object/51461/3 "2021-09-24T05:48:22Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/9328585c21c8957c7a2bea34f75729358a24119c.png)

This is what I am getting after adding debug node to every node.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 05:51 UTC](https://discourse.nodered.org/t/no-response-object/51461/4 "2021-09-24T05:51:23Z")

</div>

Where do you last see .req & .res in the msg ?

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 05:54 UTC](https://discourse.nodered.org/t/no-response-object/51461/5 "2021-09-24T05:54:32Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78062a161c37f5471b4dbbf0da3478c6c0484c31.png)

After JSON node, value is not getting in template.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:00 UTC](https://discourse.nodered.org/t/no-response-object/51461/6 "2021-09-24T06:00:43Z")

</div>

Re-read my first reply.

The error is because .req & .res are missing from the msg object when it reaches HTTP response node

The debug node coming out of the HTTP in node will definitely have these 2 properties, some other node with be dropping them. Inspect every debug node output - where is the last place you see .req & .res

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:03 UTC](https://discourse.nodered.org/t/no-response-object/51461/7 "2021-09-24T06:03:59Z")

</div>

> [@Nisha](#):
>
> After JSON node

No. Add a debug to EVERY node. You'll see them in HTTP in node then in one of the other nodes they will be missing. Where in your flow do you last see the 2 properties?

Ps: if you are starting the flow by using the python shell button, there will never be a .req or .res property. Http response MUST be fed a msg that comes originally from a HTTP in node.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 06:05 UTC](https://discourse.nodered.org/t/no-response-object/51461/8 "2021-09-24T06:05:39Z")

</div>

Yes, I am getting those two properties in http request node after post method of http (prediction).

Okay, so thats why I am not getting .req and .res after pythonshell. Is there any other way to get that?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:08 UTC](https://discourse.nodered.org/t/no-response-object/51461/9 "2021-09-24T06:08:50Z")

</div>

> [@Nisha](#):
>
> Yes, I am getting those two properties in http request node

Your earlier screenshot shows they are not present.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 06:10 UTC](https://discourse.nodered.org/t/no-response-object/51461/10 "2021-09-24T06:10:32Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3e02c4fc5db2b5ac16631d7335af28b691c717a.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:12 UTC](https://discourse.nodered.org/t/no-response-object/51461/11 "2021-09-24T06:12:26Z")

</div>

If you name your debug nodes this will be much clearer

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:14 UTC](https://discourse.nodered.org/t/no-response-object/51461/12 "2021-09-24T06:14:29Z")

</div>

You keep editing your replies & adding new info. Makes the thread hard to follow.

> [@Nisha](#):
>
> Okay, so thats why I am not getting .req and .res after pythonshell. Is there any other way to get that?

Yes, don't use python shell

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 06:15 UTC](https://discourse.nodered.org/t/no-response-object/51461/13 "2021-09-24T06:15:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d1ef46f5964f0e6fdc0147badbc797217cfa2fe0.png)

I have named debug node here.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 06:16 UTC](https://discourse.nodered.org/t/no-response-object/51461/14 "2021-09-24T06:16:13Z")

</div>

But, I have to use pythonshell to get the predicted value and post it. How can I do that? Is there any other way?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:17 UTC](https://discourse.nodered.org/t/no-response-object/51461/15 "2021-09-24T06:17:49Z")

</div>

Yes. There is always another way.

- Try an exec node to run your python  
Or
- Do it all in node-red instead of using python  
Or
- Report the issue to the author of python shell node & wait for a fix  
Or
- Fork python shell and fix it yourself

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 06:20 UTC](https://discourse.nodered.org/t/no-response-object/51461/16 "2021-09-24T06:20:09Z")

</div>

So, If I tried in node-red then do I need to write my python code in template node by selecting python format?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2021 06:22 UTC](https://discourse.nodered.org/t/no-response-object/51461/17 "2021-09-24T06:22:42Z")

</div>

Node-red is JavaScript.

If you write python it needs to be executed outside of the V8 engine.

So when I say do it all in node-red I mean ZERO python

A different solution could be to run your python separately and communicate via MQTT to trigger it and receive results.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 06:28 UTC](https://discourse.nodered.org/t/no-response-object/51461/18 "2021-09-24T06:28:35Z")

</div>

No, I cant use then node-red coz my python code is for AI and thus I must have to code in python. As you said, I have to run python seperately and communicate via MQTT to trigger.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [24 September 2021 07:00 UTC](https://discourse.nodered.org/t/no-response-object/51461/19 "2021-09-24T07:00:36Z")

</div>

You could fork the wire and recombine with a join node, then move the payload from the python back to msg.payload. this will preserve the msg.res property.  
here is an e example .

```auto
[{"id":"e558b242.7545d8","type":"http in","z":"b779de97.b1b46","name":"","url":"/testres","method":"get","upload":false,"swaggerDoc":"","x":120,"y":4020,"wires":[["3066adcc.171432","a7e16621.0a5e98"]]},{"id":"3066adcc.171432","type":"change","z":"b779de97.b1b46","name":"simulate python node","rules":[{"t":"delete","p":"res","pt":"msg"},{"t":"delete","p":"req","pt":"msg"},{"t":"set","p":"topic","pt":"msg","to":"out","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"new payload","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":4100,"wires":[["e24596fe.21c638"]]},{"id":"a7e16621.0a5e98","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"in","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":4020,"wires":[["e24596fe.21c638"]]},{"id":"e24596fe.21c638","type":"join","z":"b779de97.b1b46","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":490,"y":4020,"wires":[["7b065495.841a3c"]]},{"id":"7b065495.841a3c","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"move","p":"payload.out","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":4020,"wires":[["2f2c1603.e05c4a"]]},{"id":"2f2c1603.e05c4a","type":"http response","z":"b779de97.b1b46","name":"","statusCode":"","headers":{},"x":850,"y":4020,"wires":[]},{"id":"16627390.3c7064","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":3900,"wires":[["285b8f7f.973a6"]]},{"id":"285b8f7f.973a6","type":"http request","z":"b779de97.b1b46","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.25:1880/testres","tls":"","persist":false,"proxy":"","authType":"","x":370,"y":3880,"wires":[["41fb5918.053a8"]]},{"id":"41fb5918.053a8","type":"debug","z":"b779de97.b1b46","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":580,"y":3900,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [24 September 2021 08:44 UTC](https://discourse.nodered.org/t/no-response-object/51461/20 "2021-09-24T08:44:40Z")

</div>

where I can add pythonshell in this example?

[Next page](https://discourse.nodered.org/t/no-response-object/51461.md?page=2)
