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 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2021-07-30
猜你喜欢
  • 2022-12-23
  • 2021-08-02
  • 2021-05-25
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案