Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auth and other headers for making REST Request in powershell...
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
$dict = @{Authorization=("Basic {0}" -f $base64AuthInfo)}
$dict.Add("Accept", "application/json")
$response = Invoke-RestMethod -Uri $Url -Method Get -ContentType "application/json" -Headers $dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.