# name.toLowerCase is not a functiom

**URL:** <https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120>\
**Category:** General\
**Tags:** http-request, function-node\
**Created:** [9 January 2026 00:46 UTC](https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120 "2026-01-09T00:46:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZainH](https://avatars.discourse-cdn.com/v4/letter/z/e0b2c6/32.png) [@ZainH](https://discourse.nodered.org/u/ZainH)\
**Post date:** [9 January 2026 00:46 UTC](https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120/1 "2026-01-09T00:46:19Z")

</div>

please help. i am trying to get the access token with a http request (post) and the msg.payload has the cfedentials, but I get the error below

my flow  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0ed4ecfac5711eecf68348b8517b818754b2fa3b.png)  
My credentials

the error  
error  
name: "TypeError"  
message: "name.toLowerCase is not a function"  
stack: "TypeError: name.toLowerCase is not a function↵ at normaliseKnownHeader

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 January 2026 00:56 UTC](https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120/2 "2026-01-09T00:56:39Z")

</div>

Hi and welcome to the forum.

As you may know you have (for now) limited posts before you are _blocked_.

Open the `function` node, select all the code and paste it in your original post.

## BEFORE YOU POST IT!

See the little button up the top `</>`?

Click it, then paste the code  
Where it says `type or paste code here`.  
(See below)

```auto
type or paste code here

```

Ummmm....

Actually I am not sure what I just said is going to help, as I now see there isn't much code in there anyway.

If you are sending your credentials...... Sometimes, some tokens require UPPERCASE letters.

Where are you seeing the error?  
How do you know it is coming from the `function` node?

# AND!

## Now looking at it a bit more!

I'd not post your credentials.  
That is a **HUGE** security issue for you.

I'm not saying people HERE are nasty, but this is a PUBLIC forum, and OTHER PEOPLE can also see this information!

# WARNING!

# Please delete the picture ASAP!

(Your call)

---

<div class="post-metadata">

**Author:** ![ZainH](https://avatars.discourse-cdn.com/v4/letter/z/e0b2c6/32.png) [@ZainH](https://discourse.nodered.org/u/ZainH)\
**Post date:** [9 January 2026 01:13 UTC](https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120/3 "2026-01-09T01:13:37Z")

</div>

hey dude sorry about that - the client id and secret was posted but i left out the url ( 🤪)  
i used chat GPT and the problem was that I was placing msg.payload in the headers section of the HTTP REQUEST node. msg.payload is automatically passed to body of the HTTP REQUEST node in my credential function i had to define like this the headers part:  
Chat GPT resolved my problem with code below - thanks

```auto
msg.method = "POST";
msg.url = "https://xxxxxxxconnect/token";

msg.headers = {
  "Content-Type": "application/x-www-form-urlencoded",
  "Accept": "application/json"
};

msg.payload =
  "grant_type=client_credentials" +
  "&client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
  "&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

return msg;

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [9 January 2026 01:15 UTC](https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120/4 "2026-01-09T01:15:35Z")

</div>

(You could have just added that reply to the original post, but......)

I'm not sure where the problem is happening.

I may have to hope someone else smarter than me can see what I'm missing.

---

<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:** [9 April 2026 01:16 UTC](https://discourse.nodered.org/t/name-tolowercase-is-not-a-functiom/100120/5 "2026-04-09T01:16:13Z")

</div>

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