Jump to content
Pulseway 9.14 🔥

Featured Replies

Posted

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?

Create an account or sign in to comment