Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Wrong encoding on PowerShell Invoke-WebRequest POST

$
0
0

I'm using Invoke-WebRequest POST method to send an text data. After sendingthetextin the post body is wrong.

$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"

Fiddler:

POST http://www.mydomain.com/ HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 6.2; cs-CZ) WindowsPowerShell/4.0
Content-Type: text/plain; charset=utf-8
Host: www.mydomain.com
Content-Length: 31

zlutouck� kun �pel d�belsk� �dy

Itstill needssomesettings?

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles