Testing ASP.Net MVC WebApi from Powershell

$j = ConvertTo-Json @{email = “a@b.c”;source = 1; secret = “public”}

Invoke-RestMethod -uri http://127.0.0.3:8080/api/OptOut/ -Method POST -Body $j -ContentType “application/json”

//Here is the server code:

public void Post(Unsub unsub)

{

}

Leave a comment