I use the POST method of the Invoke-WebRequest method to send text data. After sending the text with the wrong encoding.
Script:
$postData = "žluťoučký kůň úpěl ďábelské ódy" Invoke-WebRequest -Uri 'http://www.mydomain.com/' -Method Post -Body $postData -ContentType "text/plain; charset=utf-8"
Violinist:
POST http:
Edited
It seems like you need to convert the text to utf8 first. PowerShell ISE uses a different encoding by default. In my case, windows-1250.
$text = "žluťoučký kůň úpěl ďábelské ódy" $postData = [System.Text.Encoding]::UTF8.GetBytes($text) Invoke-WebRequest -Uri 'http://www.mydomain.com/' -Method Post -Body $postData -ContentType "text/plain; charset=utf-8"
Marek
source share