# Should node-red nodes use HTTP request() or got()?

**URL:** <https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392>\
**Category:** Developing Nodes\
**Created:** [24 April 2020 03:20 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392 "2020-04-24T03:20:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnwalicki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johnwalicki/32/8848_2.png) [@johnwalicki](https://discourse.nodered.org/u/johnwalicki)\
**Post date:** [24 April 2020 03:20 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392/1 "2020-04-24T03:20:39Z")

</div>

In the few Node-RED nodes that I've created that wrap an API, I've been using request to make HTTP request calls. I wonder if I should switch the nodes to use got ? Or axios?

I converted one of my node-red packages from request() to got().  
It executes essentially the same but I didn't run any performance tests.

Downside would be that my nodes would require node.js v8 or higher.

I did a quick unscientific survey on my system - limited by the nodes that I have installed on my Linux system.

```auto
$ locate node_modules/request/request.js | grep node-red | wc -l
36
$ locate node_modules/got/index.js | grep node-red | wc -l
2
$ locate node_modules/axios/index.js | grep node-red | wc -l
6

```

Any recommendations?  
-- John

---

<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 April 2020 07:07 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392/2 "2020-04-24T07:07:50Z")

</div>

Axios has more stars and forks than all of them but request is most common

Source: [https://www.npmtrends.com/axios-vs-fetch-vs-got-vs-ky-vs-request-vs-simple-get-vs-superagent](https://www.npmtrends.com/axios-vs-fetch-vs-got-vs-ky-vs-request-vs-simple-get-vs-superagent)

Good analysis here...

> **[Request is going into maintenance mode, this is what you need to know](https://nodesource.com/blog/express-going-into-maintenance-mode)**
>
> Request is going into maintenance mode, find the implications for the Node.js ecosystem and the best-supported alternatives to replace it.

---

<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:** [24 April 2020 12:51 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392/3 "2020-04-24T12:51:01Z")

</div>

The `request` module is now deprecated and will no longer be receiving _any_ fixes.

No new code should be written using `request` and an alternative should be picked.

There are lots of candidates. The `got `module provides this comparison chart that, perhaps unsurprisingly, puts `got` ahead of the others - [https://github.com/sindresorhus/got#comparison](https://github.com/sindresorhus/got#comparison)

I don't have a strong opinion about it yet, but we do have an open issue to migrate the core HTTP Request node to something: [https://github.com/node-red/node-red/issues/2481](https://github.com/node-red/node-red/issues/2481).

If anyone in the community wanted to find a way to start contributing, this would be very welcome first issue to tackle.... The hard part is ensuring 100% compatibility with the node's current behaviour with the `request` module. Just let us know before you start playing with it.

---

<div class="post-metadata">

**Author:** ![johnwalicki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/johnwalicki/32/8848_2.png) [@johnwalicki](https://discourse.nodered.org/u/johnwalicki)\
**Post date:** [28 April 2020 03:14 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392/4 "2020-04-28T03:14:50Z")

</div>

Thanks for the articles. Those links are what kicked me into thinking about migrating. I've converted my Node-RED nodes to use got for network requests. I compared several examples and read some of the documentation. got was much easier to implement than axios in my relatively simple use case.  
-- John

---

<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:** [28 April 2020 10:47 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392/5 "2020-04-28T10:47:26Z")

</div>

🙂 - great - if you feel like helping to update any of the project node-red-nodes or node-red-web-nodes please feel free.

---

<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:** [27 June 2020 10:47 UTC](https://discourse.nodered.org/t/should-node-red-nodes-use-http-request-or-got/25392/6 "2020-06-27T10:47:29Z")

</div>

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