Posted April 5, 20196 yr Has anyone successfully made RESt calls using powershell Invoke-RestMethod or Invoke-WebRequest? Can't see, to get the header syntax Have tried $header = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($username):$($password)"))} Invoke-RestMethod -uri https://api.pulseway.com/v2/systems -Method POST -Header $header -ContentType "application/json" but keep getting '400 Bad request' any pointers?
Has anyone successfully made RESt calls using powershell Invoke-RestMethod or Invoke-WebRequest?
Can't see, to get the header syntax
Have tried
$header = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($username):$($password)"))}
Invoke-RestMethod -uri https://api.pulseway.com/v2/systems -Method POST -Header $header -ContentType "application/json"
but keep getting '400 Bad request'
any pointers?