Last active
February 29, 2016 16:02
-
-
Save ctigeek/8ff0aa50df4499258391 to your computer and use it in GitHub Desktop.
Auth and other headers for making REST Request in powershell...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 | |
$response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment