Pass Variable values from URL

Is this possible?

like, server.local/page?var1=testing1&var2=testing2

Thank you!

Hello Jacob-Evans,

I managed to do it using the following syntax :

$MyEndpoint = New-UDEndpoint -Url “/endpoint/:method” -Method GET -Endpoint {
param($method,$param1,$param2,$param3,$param4,$param5)
{ScriptBlock}
}

and thus I can call this endpoint using an URL with 1 or multiples param using URL like:

http://MyUDDashboard:port/api/endpoint/method?param1=val1&param2=val2

Then you can for instance have a switch case in the script block and do different methods.

Let me know if you have any questions :slight_smile:

Cheers !

So, i’ve never messed with using an Endpoint as a page, can you provide me a little more info on how you do that?

Right now a page has its own ps1 file that i join in. Each page has a New-UDpage and all the assorted stuff with that.

Would love to know more about how this works…