# HTTP request GET - JSON parsing error

**URL:** <https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738>\
**Category:** General\
**Tags:** http-request, function-node\
**Created:** [5 February 2023 16:30 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738 "2023-02-05T16:30:43Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [5 February 2023 16:30 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/1 "2023-02-05T16:30:43Z")

</div>

Hi  
I am having trouble to get JSON content into Node-red. I think that I have identified the problem is in HTTP request.  
If I set to as parsed JSON object. It returns as JSON parse error.  
If I set it to retuns as UTF-8 and try to use Json node to parse it It says "Unexpected token ﻿ in JSON at position 0"  
The Json output seems OK to me but it is not parse corectly. and return as string with 1000+ characters.  
Would you be able to help?  
Bewst regards

This is the output of HTTP request:

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 February 2023 16:44 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/2 "2023-02-05T16:44:29Z")

</div>

I think if you feed it into a JSON node instead, it will tell you where the problem is.

---

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [7 February 2023 09:00 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/3 "2023-02-07T09:00:22Z")

</div>

Hi Colin

I did feed it into JSON node, and the problem is "unexpected token in JSON at position 0".

I have made it successfully read and parse in Python. Which proofs that the string is OK. What I did I request HTTP get and store the result to file and than read the file in Python. And all is fine.

The problem is in parsing in Node-red.

Thanks for trying to help

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 February 2023 09:27 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/4 "2023-02-07T09:27:52Z")

</div>

That is a long string (10512). What I would do for debugging is sent that payload to a file write node to dump it into a txt file. That way you could share the actual data on the forum for people to take a look at.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 February 2023 13:37 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/5 "2023-02-07T13:37:58Z")

</div>

> [@bonito](#):
>
> unexpected token in JSON at position 0

That means that the first character msg.payload is not a `{`. Perhaps there is a non-printing character on the front. Is debug 4 connected to the same node output as the JSON node?

I am assuming that you are not using an ancient version of node-red.

---

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [7 February 2023 20:42 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/6 "2023-02-07T20:42:11Z")

</div>

Hi  
I thougth that the first character is wrong or there is something else. I exported it but there is nothing visible.

I dowloaded the Node red only couple of weeks ago, so I do not think so that it is old version. v3.0.2

Unfortunately I can not download the full object as zenofmud suggested, because I am new user.

Yes debug 4 is directly on the output of http request as well as the Json node.

Thank you very much for trying to help.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 February 2023 09:50 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/8 "2023-02-08T09:50:59Z")

</div>

Feed the message containing the string into a function containing

```auto
msg.payload = Buffer.from(msg.payload)
return msg;

```

and then to a debug node. You will then be able to see exactly what is at the start of the string.

---

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [8 February 2023 20:57 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/9 "2023-02-08T20:57:19Z")

</div>

Hi Colin,

It was interesting now there is at begining of string this

ï»¿{  
"Monitor": {  
"DeviceInfo": {  
"D

But when I use a change node to search for ï»¿{ and replace with { it does nothing, and the string is instead of 10511 characters long 10518 characters long.

But I will have a few more goes with this function.

Thank you for the help so far

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 February 2023 21:33 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/10 "2023-02-08T21:33:32Z")

</div>

When I put the data you sent me into a `inject` node as a type string and send it thru the `json` node and then to a `debug` node, it comes as an object.

In addition, if I send it straight to a `debug` node, the string is 7,491 characters where yours is 10,512 characters so it is not the data you are having an issue with.

---

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [8 February 2023 22:23 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/11 "2023-02-08T22:23:30Z")

</div>

Paul,

I do not understand I am attaching the file which was extracted rigth at the minute and says 10511.  
[loging.json](https://discourse.nodered.org/uploads/short-url/mxQm0ZukmKspAK50rcId6U5X3cH.json) (10.3 KB)

This time I did not change extension or open in any editor proror to attaching, still same 10511.

I do not understand.

I tried the exact same file which I sent to you, I have 10520 character and it does not work. I am lost even more.

Can you send the file back to me if it get somehow formated?

Notepad++ says document length10517 and 341 lines and 536 words, characters without line endings 9833. The file which I sent first.

The document which I have just attached Chracters (withput line endings) :9832, Words: 536, Lines:341, Document length: 10516.

I am using Windows 7 but the node red runs on Linux Raspberry Pi

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 February 2023 01:14 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/12 "2023-02-09T01:14:05Z")

</div>

That file is valid json and shows me no errors.  
What version of NR and node.js are you running? (you can get it from the startup log)

Attached is a flow where the inject node contains the login.json file which when I look at it it has 10,177 characters and takes up 12K on disk - I am running on a Mac. Note that in the `json` node the option `Format JSON string` is NOT checked. This makes the output smaller and may be why you are seeing a size of 10520.

```auto
[{"id":"d8457a23b86d841a","type":"debug","z":"024fd26097e68de9","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":80,"wires":[]},{"id":"e9eb24911f860aca","type":"json","z":"024fd26097e68de9","name":"","property":"payload","action":"","pretty":false,"x":410,"y":140,"wires":[["b2753626b6cb39b7","111513e462ba8ae2"]]},{"id":"b2753626b6cb39b7","type":"debug","z":"024fd26097e68de9","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":140,"wires":[]},{"id":"38b0618e8c7384c3","type":"debug","z":"024fd26097e68de9","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":660,"y":200,"wires":[]},{"id":"44adfe2b8a45c043","type":"catch","z":"024fd26097e68de9","name":"","scope":null,"uncaught":false,"x":420,"y":280,"wires":[["6f8f704c32106735"]]},{"id":"111513e462ba8ae2","type":"json","z":"024fd26097e68de9","name":"","property":"payload","action":"","pretty":true,"x":410,"y":200,"wires":[["38b0618e8c7384c3"]]},{"id":"6f8f704c32106735","type":"debug","z":"024fd26097e68de9","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":660,"y":280,"wires":[]},{"id":"55e37b2e2679c0d1","type":"inject","z":"024fd26097e68de9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"Monitor\":{\"DeviceInfo\":{\"DeviceName\":\"TCW241\",\"HostName\":\"TCW241\",\"ID\":\"5C:32:C5:00:9E:C2\",\"FwVer\":\"TCW241-v1.240\",\"MnfInfo\":\"www.teracomsystems.com\",\"SysContact\":\"Petr\",\"SysName\":\"Garaze Relay\",\"SysLocation\":\"Garaze Anglie\"},\"S\":{\"S1\":{\"description\":\"Garaz\",\"id\":\"28245C75D0013C29\",\"item1\":{\"value\":\"4.5\",\"unit\":\"°C\",\"alarm\":\"0\",\"min\":\"-40.0\",\"max\":\"85.0\",\"hys\":\"8.5\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S2\":{\"description\":\"Sklenik\",\"id\":\"28502E75D0013C83\",\"item1\":{\"value\":\"1.3\",\"unit\":\"°C\",\"alarm\":\"0\",\"min\":\"-40.0\",\"max\":\"45.0\",\"hys\":\"4.0\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S3\":{\"description\":\"Conservator\",\"id\":\"28AE7C75D0013CF4\",\"item1\":{\"value\":\"8.6\",\"unit\":\"°C\",\"alarm\":\"0\",\"min\":\"-40.0\",\"max\":\"45.0\",\"hys\":\"8.5\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S4\":{\"description\":\"West\",\"id\":\"2894DA75D0013C79\",\"item1\":{\"value\":\"2.6\",\"unit\":\"°C\",\"alarm\":\"0\",\"min\":\"-40.0\",\"max\":\"85.0\",\"hys\":\"8.5\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S5\":{\"description\":\"East\",\"id\":\"283E2F75D0013C9E\",\"item1\":{\"value\":\"3.8\",\"unit\":\"°C\",\"alarm\":\"0\",\"min\":\"-40.0\",\"max\":\"85.0\",\"hys\":\"8.5\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S6\":{\"description\":\"S6\",\"id\":\"0000000000000000\",\"item1\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S7\":{\"description\":\"S7\",\"id\":\"0000000000000000\",\"item1\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"S8\":{\"description\":\"S8\",\"id\":\"0000000000000000\",\"item1\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"},\"item2\":{\"value\":\"---\",\"unit\":\"---\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}}},\"AI\":{\"AI1\":{\"description\":\"PSU 24V\",\"value\":\"23.98\",\"unit\":\"V\",\"multiplier\":\"1.000\",\"offset\":\"0.000\",\"alarm\":\"0\",\"min\":\"20.00\",\"max\":\"30.00\",\"hys\":\"0.30\"},\"AI2\":{\"description\":\"Auxilarygaraz1\",\"value\":\"0.03\",\"unit\":\"V\",\"multiplier\":\"1.000\",\"offset\":\"0.000\",\"alarm\":\"1\",\"min\":\"0.00\",\"max\":\"60.00\",\"hys\":\"0.10\"},\"AI3\":{\"description\":\"Auxilary garaz\",\"value\":\"0.03\",\"unit\":\"V\",\"multiplier\":\"1.000\",\"offset\":\"0.000\",\"alarm\":\"1\",\"min\":\"0.00\",\"max\":\"60.00\",\"hys\":\"1.00\"},\"AI4\":{\"description\":\"Auxilarygaraze3\",\"value\":\"0.03\",\"unit\":\"V\",\"multiplier\":\"1.000\",\"offset\":\"0.000\",\"alarm\":\"1\",\"min\":\"0.00\",\"max\":\"60.00\",\"hys\":\"1.00\"}},\"VI\":{\"VI1\":{\"description\":\"Virtual Input 1\",\"value\":\"---\",\"unit\":\"---\",\"multiplier\":\"1.000\",\"offset\":\"0.0000\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"},\"VI2\":{\"description\":\"Virtual Input 2\",\"value\":\"---\",\"unit\":\"---\",\"multiplier\":\"1.000\",\"offset\":\"0.0000\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"},\"VI3\":{\"description\":\"Virtual Input 3\",\"value\":\"---\",\"unit\":\"---\",\"multiplier\":\"1.000\",\"offset\":\"0.0000\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"},\"VI4\":{\"description\":\"Virtual Input 4\",\"value\":\"---\",\"unit\":\"---\",\"multiplier\":\"1.000\",\"offset\":\"0.0000\",\"alarm\":\"0\",\"min\":\"---\",\"max\":\"---\",\"hys\":\"---\"}},\"DI\":{\"DI1\":{\"description\":\"Alarm \",\"value\":\"OFF\",\"valuebin\":\"0\",\"alarmState\":\"ON\",\"alarm\":\"0\"},\"DI2\":{\"description\":\"Dvere\",\"value\":\"CLOSED\",\"valuebin\":\"0\",\"alarmState\":\"OPEN\",\"alarm\":\"0\"},\"DI3\":{\"description\":\"Vrata\",\"value\":\"OPEN\",\"valuebin\":\"1\",\"alarmState\":\"OPEN\",\"alarm\":\"1\"},\"DI4\":{\"description\":\"Digital Input 4\",\"value\":\"OPEN\",\"valuebin\":\"1\",\"alarmState\":\"CLOSED\",\"alarm\":\"0\"}},\"R\":{\"R1\":{\"description\":\"Zalevani\",\"value\":\"OFF\",\"valuebin\":\"0\",\"pulseWidth\":\"180.0\",\"control\":\"Function 1\"},\"R2\":{\"description\":\"Alarm remote\",\"value\":\"OFF\",\"valuebin\":\"0\",\"pulseWidth\":\"0.2\",\"control\":\"0\"},\"R3\":{\"description\":\"Garaze PSU\",\"value\":\"OFF\",\"valuebin\":\"0\",\"pulseWidth\":\"0.3\",\"control\":\"0\"},\"R4\":{\"description\":\"Relay 4\",\"value\":\"OFF\",\"valuebin\":\"0\",\"pulseWidth\":\"0.4\",\"control\":\"0\"}},\"HTTPPush\":{\"Key\":\"\",\"PushPeriod\":\"1800\"},\"hwerr\":\"\",\"Alarmed\":\"1\",\"Scannig\":\"\",\"Time\":{\"Date\":\"08.02.2023\",\"Time\":\"22:55:24\"}}}","payloadType":"json","x":410,"y":80,"wires":[["d8457a23b86d841a","e9eb24911f860aca"]]}]

```

Please try it and see what you get.

---

<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:** [9 February 2023 07:36 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/13 "2023-02-09T07:36:02Z")

</div>

I see the offending chars if i load the loging.json using file node and output binary.

 ![chrome_screenshot_1675927712733](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/9/09c6bb86e49c81919a9fb2570f325350a2aeb98e.png)  
How is the file created, do you have any control over it..

I can remove the offending chars with a JSONata expression

```auto
"{" & substringAfter($$.payload, "{")

```

eg.

```auto
[{"id":"3641dacefc1e2261","type":"inject","z":"da8a6ef0b3c9a5c8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":4780,"wires":[["4c02c3c535cfe9fd"]]},{"id":"4c02c3c535cfe9fd","type":"file in","z":"da8a6ef0b3c9a5c8","name":"","filename":".node-red/loging.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":340,"y":4780,"wires":[["038d382a28b70294","c75d41fdfaeeafaa"]]},{"id":"038d382a28b70294","type":"change","z":"da8a6ef0b3c9a5c8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"{\" & $substringAfter($$.payload, \"{\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":4840,"wires":[["c75d41fdfaeeafaa"]]},{"id":"c75d41fdfaeeafaa","type":"json","z":"da8a6ef0b3c9a5c8","name":"","property":"payload","action":"","pretty":false,"x":670,"y":4840,"wires":[["5a4aa4835d6d0dad"]]},{"id":"5a4aa4835d6d0dad","type":"debug","z":"da8a6ef0b3c9a5c8","name":"debug 231","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":4880,"wires":[]}]

```

output

 ![chrome_screenshot_1675927795251](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/392119d44b2aecf984a32fcdf46f59a88104e75c.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 February 2023 09:11 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/14 "2023-02-09T09:11:18Z")

</div>

@E1cid Interesting! By inserting the data from that file into an `inject` node I didn't hit the error but storing it into a file and reading it in, I do see the error.

@bonito If you don't want to use JSONata, you could install `node-red-contrib-string` and set it to `collapseWhitespace`  
 ![Screenshot 2023-02-09 at 4.06.05 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19382d884a8925394293a4ca70ed70beca35960e.png)

and sent the results thru the `json` node and it works fine.

---

<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:** [9 February 2023 16:51 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/15 "2023-02-09T16:51:14Z")

</div>

Never used the string node, Would that collapse all space in the string values of the properties to? i.e would `test test` become `testtest`

---

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [9 February 2023 17:59 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/16 "2023-02-09T17:59:54Z")

</div>

> [@zenofmud](#):
>
> node-red-contrib-string

Hi E1cid

No I do not have much control it is a web relay with this interface. I will try your suggestion,  
Thank you for helping.

---

<div class="post-metadata">

**Author:** ![bonito](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bonito](https://discourse.nodered.org/u/bonito)\
**Post date:** [9 February 2023 18:13 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/17 "2023-02-09T18:13:28Z")

</div>

Hi zenofmud,

Thank you very much for you help, it works perfectly with the string - white space remove.

It would never occur to me. It is difficult if I am trying to learn something new and it works differently than it should. Thank you very much for you help and time and patiance with me.

Best regards

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 February 2023 20:52 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/18 "2023-02-09T20:52:36Z")

</div>

From the ['Flows' page for the node](https://flows.nodered.org/node/node-red-contrib-string)

> Additional string parsing functionality and compatibility have been added from the [fork](https://github.com/Steveorevo/string.js).

If you click on the `fork` link and read thru you will see:

### - collapseWhitespace()

Converts all adjacent whitespace characters to a single space.

---

<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:** [10 April 2023 20:53 UTC](https://discourse.nodered.org/t/http-request-get-json-parsing-error/74738/19 "2023-04-10T20:53:34Z")

</div>

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