I have the following REST URL:
https://webserviceconsume.domain.local/web/api/rest?formatType=json&opName=userAPI&opData={param0:"sample",param1:{"list":[{"name1":"sample1","value1":"sample1"},{"name2":"sample2","value2":"sample2"}]},param2:-1}
I want to write a PowerShell script to call this URI. It should basically look like this:
$response = Invoke-RestMethod -Uri 'https://webserviceconsume.domain.local/web/api/rest' -Body $body -Headers $headers -ContentType "application/json"
Here's the header:
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("accept", 'application/json')
$headers.Add("X-App-Key", 'XXXXX')
and then I want to build the $body but don't know how to do it.