Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

Invoke-WebRequest - Test ASP.NET Web API with PowerShell

Tags: powershell, web-development, web-api

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

Show Just the 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

http://technet.microsoft.com/en-us/library/hh849901.aspx

http://technet.microsoft.com/en-us/library/hh849898.aspx