To authenticate your request, you need to encode your username and password using Base64. PowerShell provides a convenient way to achieve this. Additionally, you need to specify the content type as "text/plain" for the request headers.
$base64Auth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${username}:${password}")) $headers = @{ "Authorization" = "Basic $base64Auth" "Content-Type" = "text/plain" }