# How do I get data from database and send it to postman using postman

**URL:** https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072
**Category:** General
**Created:** [5 March 2021 09:13 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072 "2021-03-05T09:13:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Darshil](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@Darshil](https://discourse.nodered.org/u/Darshil)
#### Post date: [5 March 2021 09:13 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/1 "2021-03-05T09:13:00Z")

</div>

I have recently started using Node-Red.  
I want to understand how could I send data from my MySQL database to postman using Node-Red.  
I was advised to use GET option in http in node to send data to postman.  
I not sure how it works.

Thanks in advance

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [5 March 2021 09:20 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/2 "2021-03-05T09:20:38Z")

</div>

Perhaps I am missing something, but isn't postman just an API (dev/testing) client ? This is what the http request node can do as well.

The cookbook has [some examples](https://cookbook.nodered.org) about get/post requests.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [5 March 2021 09:28 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/3 "2021-03-05T09:28:51Z")

</div>

As Mr Backman says, Postman is simply a tool for issuing API calls and seeing the responses. I stopped using it in favour of an extension for VScode that lets me create a suitable file, click to issue commands and get responses back, all inside VScode which is very convenient.

The simplest way to create an API with Node-RED is to use a combination of the http-in and http-out nodes. The -in node defines the API endpoint (URL and Type - e.g. GET/PUT/...). The -out node provides the response back to the requestor. In between, you can add other nodes that formulate the required output.

---

<div class="post-metadata">

### Author: ![Darshil](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@Darshil](https://discourse.nodered.org/u/Darshil)
#### Post date: [5 March 2021 09:35 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/4 "2021-03-05T09:35:34Z")

</div>

Okay,  
So how can I get the URL for connecting my database??

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [5 March 2021 09:50 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/5 "2021-03-05T09:50:51Z")

</div>

Database connections go over tcp and ports, not over url's.

So if you know the host (ip/fqdn) your database is running on and it is mysql, it is port 3306. For this you will need to have something like [the mysql node](https://flows.nodered.org/node/node-red-node-mysql) installed.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [5 March 2021 15:22 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/6 "2021-03-05T15:22:19Z")

</div>

I think we are talking at cross-purposes.

Node-RED provides the URL - you define it when you use the http-in node.

You then need to write a flow that fits between the http-in and http-out nodes that queries your db, returning the results to the msg.payload that you then pass to the http-out node.

---

<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: [4 May 2021 15:22 UTC](https://discourse.nodered.org/t/how-do-i-get-data-from-database-and-send-it-to-postman-using-postman/42072/7 "2021-05-04T15:22:23Z")

</div>

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