powershell utf8 curl

powershell curl utf-8  乱码

$body = ‘{“users”:[“yang.sun”],”msg”:”‘ +  “中文字符串”  +'”}’

#使用此命令可以将,将要发送的内容转为utf-8编码方式【指定编码方式可转换为任何方式】。

[array]$params =[System.Text.Encoding]::UTF8.GetBytes($body)
curl -Uri “uri; -Method Post  -ContentType “application/json” -Body $params 

 

posted @ 2020-06-08 19:07  mopheify  阅读(712)  评论(0编辑  收藏  举报