# Very strange behavior

**URL:** https://discourse.nodered.org/t/very-strange-behavior/74404
**Category:** General
**Created:** [30 January 2023 11:26 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404 "2023-01-30T11:26:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![makerstorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/makerstorage/32/57594_2.png) [@makerstorage](https://discourse.nodered.org/u/makerstorage)
#### Post date: [30 January 2023 11:26 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404/1 "2023-01-30T11:26:52Z")

</div>

Hi Node-Reders,  
I have a very strange thing happening. I am sending a post request to an api endpoint.  
there are number of nodes that I coded the logic but at the end I am sending below msg to the http request node.

```auto
{
   "symbol":"THYAO",
   "direction":"BUY",
   "lot":1,
   "payload":"{\"symbol\":\"THYAO\",\"direction\":\"BUY\",\"pricetype\":\"piyasa\",\"price\":\"\",\"lot\":\"1\",\"sms\":true,\"email\":false,\"subAccount\":\"\"}",
   "headers":{
      "Content-Type":"application/json; charset=utf-8",
      "APIKEY":"API-fEceFLSYQFLvI5h5MeSnNxJ4V5B3pE8YucJvyRfxFw",
      "Authorization":"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJBdXRob3JpemF0aW9uIjoiQXV0aG9yaXplZCIsIkN1c3RvbWVyTm8iOiIyMDgwOTE2OCIsIk5ld3NsZXR0ZXIiOiJUcnVlIiwiSXNCbG9ja2VkIjoiRmFsc2UiLCJFbWFpbCI6Im5lcmdpbmVyQGdtYWlsLmNvbSIsIlVzZXJJZCI6IjQwMTMiLCJEZW5pemJhbmsiOiJUcnVlIiwibmJmIjoxNjc1MDY4NzczLCJleHAiOjE2NzUxNTUxNzN9.IcVLbSc9EAshmBXS79uXaiaYbCTGDHSgtv_QHX3XqYc",
      "Checker":"da17aa13bc48f043deddafd35f60e8801fa9f40025d74e5e2a109a6160a1148e"
   },
   "_msgid":"1124136dca420cf7"
}

```

It response back with this error message.

```auto
<html>
  <head>
    <title>Request Rejected</title>
  </head>
  <body>The requested URL was rejected. Please consult with your administrator. <br>
    <br>Your support ID is: 12854212357508180978 <br>
    <br>
    <a href='javascript:history.back();'>[Go Back]</a>
  </body>
</html>

```

But If I insert an inject node before the http request and insert the data on the inject node it works. Please find the debug out come of the inject node.

```auto
{
   "symbol":"THYAO",
   "direction":"BUY",
   "lot":1,
   "payload":"{\"symbol\":\"THYAO\",\"direction\":\"BUY\",\"pricetype\":\"piyasa\",\"price\":\"\",\"lot\":\"1\",\"sms\":true,\"email\":false,\"subAccount\":\"\"}",
   "headers":{
      "Content-Type":"application/json; charset=utf-8",
      "APIKEY":"API-fEceFLSYQFLvI5h5MeSnNxJ4V5B3pE8YucJvyRfxFw",
      "Authorization":"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJBdXRob3JpemF0aW9uIjoiQXV0aG9yaXplZCIsIkN1c3RvbWVyTm8iOiIyMDgwOTE2OCIsIk5ld3NsZXR0ZXIiOiJUcnVlIiwiSXNCbG9ja2VkIjoiRmFsc2UiLCJFbWFpbCI6Im5lcmdpbmVyQGdtYWlsLmNvbSIsIlVzZXJJZCI6IjQwMTMiLCJEZW5pemJhbmsiOiJUcnVlIiwibmJmIjoxNjc1MDY4NzczLCJleHAiOjE2NzUxNTUxNzN9.IcVLbSc9EAshmBXS79uXaiaYbCTGDHSgtv_QHX3XqYc",
      "Checker":"da17aa13bc48f043deddafd35f60e8801fa9f40025d74e5e2a109a6160a1148e"
   },
   "_msgid":"39b6baeb0821bbdd"
}

```

I text compare the data and only the \_msgid is different.  
I select the complete object output from the debug node.

What is the difference can be that cause the api end point returns with error in one massage but ok with the other. Do msg object have some hidden properties that I can not output?  
Any idea is welcome.

PS:  
The apikey is fake

Regards,  
Nuri

---

<div class="post-metadata">

### Author: ![makerstorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/makerstorage/32/57594_2.png) [@makerstorage](https://discourse.nodered.org/u/makerstorage)
#### Post date: [30 January 2023 12:06 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404/3 "2023-01-30T12:06:56Z")

</div>

changing return as below also do not solve.

```auto
return {
    "payload":msg.payload,
    "headers":msg.headers
};

```

So this is not related with the msg object. But what can be the reason of error so strange.  
Please help!

---

<div class="post-metadata">

### Author: ![makerstorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/makerstorage/32/57594_2.png) [@makerstorage](https://discourse.nodered.org/u/makerstorage)
#### Post date: [30 January 2023 14:24 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404/4 "2023-01-30T14:24:56Z")

</div>

I find out that I am making two requests very rapidly. I put a delay and it solve the issue.  
Sorry for disturbing

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [30 January 2023 19:24 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404/5 "2023-01-30T19:24:45Z")

</div>

IF that is your real API key you may wish to edit/delete/change it...

---

<div class="post-metadata">

### Author: ![makerstorage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/makerstorage/32/57594_2.png) [@makerstorage](https://discourse.nodered.org/u/makerstorage)
#### Post date: [31 January 2023 06:30 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404/6 "2023-01-31T06:30:27Z")

</div>

As I mentioned in the post I fake the APIKEY it is not real.  
Thanks for the warning

---

<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: [14 February 2023 06:31 UTC](https://discourse.nodered.org/t/very-strange-behavior/74404/7 "2023-02-14T06:31:16Z")

</div>

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