Invoke-WebRequest - Test ASP.NET Web API with PowerShell
This is awesome. I don’t need to open Firefox or Fiddler to test my Web API. I can do it all from PowerShell.
Example with localhost
- Invoke-WebRequest -uri http://localhost/Attendance.WebApi/api/person
Show Just the Content
- (Invoke-WebRequest -uri http://localhost/Attendance.WebApi/api/person).Content
Show JSON Content as a PowerShell Object
- (Invoke-WebRequest -uri http://localhost/Attendance.WebApi/api/person).Content | ConvertFrom-Json
- This is equivalent to Invoke-RestMethod
See Also