Search K
Appearance
Appearance
Execute a PowerShell script upon a data body posted via a POST
request.
http:///MinuteView/api/AdskVault/PostData
.Content-Type
as application/json
{
"Title" : "Hello World",
"Data": {
"Hello Universe" : 42
}
}
Post Data PowerShell
Write-Host "Start Test PostData"
Write-Host "Keys and Values:"
foreach ($property in $postObj.Properties()) {
Write-Host "$($property.Name): $($property.Value.ToString())"
}
$nestedData = $postObj['Data']
Write-Host "Properties inside Data:"
foreach ($prop in $nestedData.Properties()) {
Write-Host "$($prop.Name): $($prop.Value.ToString())"
}
Write-Host "End Test PostData"
With the Post ready and the PowerShell script read, Post the JSON object (via Postman). Note that your API Client application (Postman) should return 200 OK without a body.
Open/Refresh the Post Data PowerShell script noting that the posted body now appears within the PowerShell Parameters Debug.