Created
August 10, 2019 09:50
-
-
Save AlexanderHolmeset-zz/0cc887619bf32ce0e8aecbd11e517f1d to your computer and use it in GitHub Desktop.
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
try{Invoke-RestMethod -Body $RequestBody -Method POST -Uri $uri -ContentType "application/json" -Headers @{Authorization = "Bearer $token"}} | |
catch{ | |
$ResponseResult = $_.Exception.Response.GetResponseStream() | |
$ResponseReader = New-Object System.IO.StreamReader($ResponseResult) | |
$ResponseBody = $ResponseReader.ReadToEnd() | |
} | |
$ResponseBody |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment