Using curl:
curl -d '{ "firstName": "John", "lastName": "Doe" }' -H "Content-Type: application/json" -X POST https://echo.jannemattila.com/api/echo
Using PowerShell:
$url = "https://echo.jannemattila.com/api/echo"
$data = @{
firstName = "John"
lastName = "Doe"
}
$body = ConvertTo-Json $data
Invoke-RestMethod -Body $body -ContentType "application/json" -Method "POST" -DisableKeepAlive -Uri $url
Using Visual Studio Code with
REST Client extension:
### Invoke Echo
POST https://echo.jannemattila.com/api/echo HTTP/1.1
Content-Type: application/json; charset=utf-8
{
firstName: "John"
lastName: "Doe"
}