Making a PowerShell POST request if a body param starts with '@'
I want to make a POST request in PowerShell. Following is the body details in Postman. { "@type":"login", "username":"xxx@gmail.com", "password":"yyy" } How do I pass this in PowerShell? You should be able to do the following: $params = @{"@type"="login"; "username"="xxx@gmail.com"; "password"="yyy"; } Invoke-WebRequest -Uri http://foobar.com/endpoint -Method POST -Body $params This will send the post as the body. However - if you want to post this as a Json you might want to be explicit. To post this as a JSON you can specify the ContentType and convert the body to Json by using Invoke