# Replacement for package "request-promise"?

**URL:** <https://discourse.nodered.org/t/replacement-for-package-request-promise/78347>\
**Category:** General\
**Tags:** http-request, javascript\
**Created:** [11 May 2023 07:44 UTC](https://discourse.nodered.org/t/replacement-for-package-request-promise/78347 "2023-05-11T07:44:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [11 May 2023 07:44 UTC](https://discourse.nodered.org/t/replacement-for-package-request-promise/78347/1 "2023-05-11T07:44:56Z")

</div>

I am looking for a replacement of the [request-promise](https://www.npmjs.com/package/request-promise) package that is deprecated. I tried [axios](https://github.com/axios/axios) and it generally works, but I am not 100% happy with it, especially because I am getting a strange [error](https://github.com/axios/axios/issues/4806) that is open on the axios github since early 2022.

Does anybody know of an easy to use replacement?

Requirements

- The only thing I need is sending POST requests.
- Should be using Promises.

EDIT:  
Found this nice list [Alternative libraries to request · Issue #3143 · request/request · GitHub](https://github.com/request/request/issues/3143#issue-427486416).  
Anybody can recommend one of those packages?

---

<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:** [11 May 2023 13:45 UTC](https://discourse.nodered.org/t/replacement-for-package-request-promise/78347/2 "2023-05-11T13:45:54Z")

</div>

@cameo69, can I ask:

What is wrong with using the built in low-code node "http-request" for making requests?

Are you creating a new contrib node or simply developing a flow that does HTTP requests?

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [11 May 2023 16:28 UTC](https://discourse.nodered.org/t/replacement-for-package-request-promise/78347/3 "2023-05-11T16:28:03Z")

</div>

At this point I do not have normal nodes available. I [forked malleguisse/node-jdownloader-api](https://github.com/cameo69/node-jdownloader-api) and started modifying it because lot of it was outdated. I am using it in node-red to control an instance of JDownloader.  
By now I used axios, but I am not sure if it is a good choice.  
Right now I tried converting the thing from RequestJS to an ES module, but so far I do not get it to run in node-red then; but that is another story.  
I am thinking about either publishing a flow on [flows.nodered.org](https://flows.nodered.org/) once it is ready or even compile all to a custom node, but I am not there yet. Besides, when I searched the forum, the keyword JDownloader was not mentioned, hence probably nobody would need a custom node for 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:** [11 May 2023 18:29 UTC](https://discourse.nodered.org/t/replacement-for-package-request-promise/78347/4 "2023-05-11T18:29:09Z")

</div>

Ok, if I was updating a fork that was for making an API more user friendly, I'd likely use the `got` as it is what the core of node-red uses.

That said, for an API like this, I'd likely just build flows and/or subflows that do the API calls I need using nothing but the built-in nodes of node-red (no need for any external libs)

---

<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 July 2023 18:29 UTC](https://discourse.nodered.org/t/replacement-for-package-request-promise/78347/5 "2023-07-10T18:29:41Z")

</div>

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