- Product: PowerShell Universal
- Version: 2.8.0
I have an API Endpoint where I wan’t to post swedish characters like åäö.
The problem is that the endpoint interprets the characters wrong.
PSU
New-PSUEndpoint -Url “/BodyTest” -Method “POST” -Endpoint {
Param ( $Text )
Add-Content C:\Temp\PSUlog.txt “Text = $Text”
@{
“PSVersion” = $($PSVersionTable.PSVersion.ToString())
“Body” = $Text
}
} -ErrorAction “Stop” -Timeout 0
VSCode
$Body = @{
“Text” = “Testing text with swedish characters - åäö”
} | ConvertTo-Json
Invoke-RestMethod -Uri “http://localhost:5000/BodyTest” -Body $Body -Method “Post” -ContentType “application/json”
Outcome
PSVersion Body
7.1.5 Testing text with swedish characters - ���
The logfile that is written locally says
Text = Testing text with swedish characters - ���