Quick one: Is there a system variable I can use in an API endpoint to find out what web method was used? I can see that an endpoint can be defined using more than one method (e.g. GET as well as POST) but is there a way from within the endpoint script that I can “know” how it was called?
Product: PowerShell Universal
Ooh I think I’ve found it!
$Method does indeed seem to have the value ‘GET’ or ‘POST’ depending on how the endpoint was called. I couldn’t find that in the docs. Maybe I’m just blind.
I don’t think it’s mentioned anywhere, I ran into this a while back, but thought it was just unsupported because the Cmdlet help mentions it’s accepting only a string, so didn’t think more of it at the time.