Web request with variable in the url


#1

1) Give a description of the problem
I want to make a web request and use defined variable inside the url

2) What is the expected behaviour?
return something

3) What is happening/not happening?
it return nothing, when I use “text” it works but @variable not working

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Before you make the web request, try logging the URL to console first to see if it’s being put together how you’re expecting it.


#3

Thanks for reply! How can I do it? I do not see anything in my log about the url…


#4

Instead of Make Web Request, select the “Log to console” task.


#5

when I put the expression inside a variable…it gives : 0
So I presume that its not working as expected…


#6

0 again
in the webrequest, I use the ‘expression’ option, is there another way of doing it?


#7

Put that expression in the Log to console task and look at the output.


#8

0 always


#9

I m able to get the first variable but the second one still shown as text… like:
http/myurl?lat=45.55555lon=@longitude…
It should have a transition between …maybe a formula to merge text? concatenate?


#10

In an expression box, you can concat using the + sign


#11

You need to put your variables inside {@curly_brackets} when typing the URL.


#12

I make it works this way:
https://api.openweathermap.org/data/2.5/onecall?lat=@actual_latitude + “&lon=”@actual_longitude “&units=metric&exclude=hourly,daily,minutely&lang=fr&appid=xxxxxxxxxx”

Looks like I was using & at the place of + and I also notice that the + is not even needed after a variable, it miss one and still working…

Thanks again! You found it!


#13

Glad you got it working.

If you just type the URL as a ‘value’ rather than an ‘expression’, using {@curly_brackets} for your variables, you would save yourself the whole “…”+@xyz+"…"+@abc mess

:wink:


#14

I am trying to send a text request to my AV receiver.
Instruction manual says…
“The RIO Command Set is available as ASCII text via IP (using port 9621)”
My IP is 192.168.0.39
My variable name is Russound_Command and is VERSION
That should return the version of software my receiver is using.
This does not seem to work…


#15

Have you tried a get request? Then see if the version details are returned in $response
I use the above method to access the admin page of my nas to check its status


#16

Log shows…


#17

Can you use https? It’s coming back to me, and I had issues with http when I moved to HE from ST. My nas connection uses https.


#18

No dice.


#19

Can you test from another platform? Not sure you could send the message from a browser url line, and see if you get a response. I’ve used nodered in the past to test such things, if you have a raspberry pi its installed, and is very easy to set up a simple flow to test the http response


#20

You and I have had this conversation before. And as I recall, what I am trying to do is not possible with webcore. I admit, I do not understand UDP, TCP and making http calls to devices. So, my own ignorance in this arena is the rate limiting step! :slight_smile: