Open edoutlook opened 1 month ago
Out of curiosity, Why do you wish to invoke a webrequest to your own server from the same server? What you would do instead is to call the function and return the output you need directly from the scriptblock.
While it might be possible to do - Most likely using multiple threads would solve your issue (See Start-PodeWebServer? -Threads) The reason why its failing - atleast from my testing is because each scriptblock is a 'blocking' function, which essentially means that your pode web server cant handle any more requests than its already handling, so when you are clicking the button its trying to do another request and ends up locking up since it cant handle any more requests.
I've combined three snippets from the tutorial, Basic (the services thing), Button and Route. I was hoping that I could put a button in each row of the table and Use a invoke to, eventually, do an action against a Local route/api. But for some reason, just having the embedded invoke in a button seems to time-out (on the rest get). -I can run the invoke in another ps1 script, same machine, and it works ok. I can pull the 'api' in another chrome tab and that works.
I just can't place it.
that test ps1
Here is the output of the ps1 on the same machine
I tried another powershell variant of httpwebrequest, to replace the invoke but it is overly long and didn't behave differently. I read that the Rest and Web Invoke are sort of legacy and the Httpwebrequest is 'newer'?