Hi,
this is the first time i use node-red.
I tried to create a flow with http in and get the response.
But when i go to : http://127.0.0.1:1880/trade
i see Cannot GET /trade
The HTTP In node is used to define the endpoint within Node-RED that responds to HTTP requests.
If you want it to respond to http://127.0.0.1:1880/trade then the HTTP In node should be configured with a url of /trade.
If you want the flow to then make an HTTP Request to the worldtradingdata api you currently have in the HTTP In node, then you need to add an HTTP Request node to the flow and use that to make the request.
The cookbook has lots of examples for using the different HTTP nodes - it may be worth spending a bit of time working through that so you are familiar with the different nodes - cookbook.nodered.org
Hi,
thank you for your answer.
i did check at first the cookbook and i found Simple Get request example.
But i'm trying to get response from api service.
If i paste the url directly in google chrome then i get the response in json format.
I wanted to do the same with node-red because later i want to extract some data from the json.
So i tried your second suggestion and i get nothing, HTTP Request (url=https://api.worldtradingdata.com/api/v1/stock?symbol=TSLA&api_token=)
Then i added a second HTTP Request but i suppose it's HTTP Response, i tried both
Cannot GET /trade here trade is the name of the Flow right?
Unfortunately, I don't have an API key for that site so I can't test it. Try just outputting plain text from the http-request in case something odd is happening with the parsing.
Yes it works now.
i used the inject node and i forgot to click on the button of inject node.
Thank you very much to all of you.
we can close this thread.