Pass query parameters to HTTP request node

1,402 views
Skip to first unread message

Nelson J Fernandez P

unread,
Sep 21, 2017, 6:44:34 AM9/21/17
to Node-RED
Hi guys!. I'm trying to connect my nodered to an external API service that requires the following syntax:
                                        
                                  https://api.service.com/media?source=sourceurl

where source=sourceurl it's a query parameter and its value, and I'm trying to take sourceurl from a previous msg.payload.

For doing that, I inject the sourceurl as string, add the string to the base address in a intermediate function, and then, pass the msg.payload to a HTTP request node with little success so far. I get URL source error from the API server. 

Any advice guys?  Thanks a lot...
flow.png
function.png
httpnode.png

Zenofmud

unread,
Sep 21, 2017, 6:53:45 AM9/21/17
to node...@googlegroups.com
Any advice guys?
Add some debug nodes so you can see what you are getting at each point
provide the output of the debug log
provide an export of the flow.
provide the versions of 
npm (use ‘npm -v')
node (use ‘node -v’)
node-red (get it from the console log)


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/c676e0ac-5bf2-4293-8130-6110ed147822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<flow.png><function.png><httpnode.png>

Nelson J Fernandez P

unread,
Sep 21, 2017, 7:54:36 AM9/21/17
to node...@googlegroups.com
Thanks ! with the debugs I was able to figure it out. Working now !

2017-09-21 12:53 GMT+02:00 Zenofmud <zeno...@zenofmud.org>:
Any advice guys?
Add some debug nodes so you can see what you are getting at each point
provide the output of the debug log
provide an export of the flow.
provide the versions of 
npm (use ‘npm -v')
node (use ‘node -v’)
node-red (get it from the console log)

On Sep 21, 2017, at 6:44 AM, Nelson J Fernandez P <njfern...@gmail.com> wrote:

Hi guys!. I'm trying to connect my nodered to an external API service that requires the following syntax:
                                        
                                  https://api.service.com/media?source=sourceurl

where source=sourceurl it's a query parameter and its value, and I'm trying to take sourceurl from a previous msg.payload.

For doing that, I inject the sourceurl as string, add the string to the base address in a intermediate function, and then, pass the msg.payload to a HTTP request node with little success so far. I get URL source error from the API server. 

Any advice guys?  Thanks a lot...

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/c676e0ac-5bf2-4293-8130-6110ed147822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<flow.png><function.png><httpnode.png>

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/-R2SX9U87rA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
0 new messages