Product: PowerShell Universal
Version: 3.5.5
Does anyone know how to post with a query parameter and a body?
Server:
New-PSUEndpoint -Url '/user' -Method Post -Endpoint {
param($serverName)
write-Host $serverName
write-host $body #this is blank
}
Client
Invoke-RestMethod http://localhost:5000/user?ServerName=sandbox123.domainname.com -Method Post -Body "{'username': 'adam'}" #error 400
Workaround
remove param(*)