Last active
January 27, 2017 23:05
-
-
Save praveenc/609ae48723eee82aacfe3fe3c76cc48f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Encode string to base64 | |
| # ======================= | |
| $u="username" | |
| $p="password" | |
| $b64 = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($u+":"+$p)) | |
| # E.g. For use in Authorization Headers | |
| #$headers = @{"Authorization"="Basic $b64"; | |
| # "Content-Type"="application/json"; | |
| # "charset"="UTF-8"} | |
| #Invoke-RestMethod -Method GET -Uri http://localhost:15672/api/nodes -Headers $headers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment