Node-RED shows "Error: connect ECONNREFUSED" when trying to make a POST request

I am creating a new document in an ERP software by using the POST request and REST API. This has successfully worked when I am running Node-RED separately (not under home assistant).

However, when I try to run the same sequence in Node-RED running under home assistant it shows me an error message: “Error: connect ECONNREFUSED”

The ERP software is locally hosted under:

My function node:
Screenshot from 2021-01-05 14-54-51

I am able to access the msg.url in the function node so I do not know what the issue is here.

Any help would be much appreciated.
Thanks in advance