Open Claustn opened 8 years ago
If you use special chars like ¤$ in your password, Invoke-Webrequest will give you an error, this is because powershell uses UniCode wheres as the web request expects UTF8
$result = Invoke-RestMethod -Uri $uri -Method Post -ContentType "application/$Format" -Headers $headers -Body ([System.Text.Encoding]::UTF8.GetBytes($json))
Force the json to be loaded as UTF8.
I am adding some extra stuff, so will do a PR when I get that worked out.
Awesome. Thanks for finding this!
Expected Behavior
If you use special chars like ¤$ in your password, Invoke-Webrequest will give you an error, this is because powershell uses UniCode wheres as the web request expects UTF8
Current Behavior
Possible Solution
$result = Invoke-RestMethod -Uri $uri -Method Post -ContentType "application/$Format" -Headers $headers -Body ([System.Text.Encoding]::UTF8.GetBytes($json))
Force the json to be loaded as UTF8.
Steps to Reproduce (for bugs)
Context
I am adding some extra stuff, so will do a PR when I get that worked out.
Your Environment