我正在尝试在 2 个场景中使用 Invoke-Webrequest / Invoke-restmethod 发送帖子。其中一个运行良好,另一个运行良好,但用问号替换希伯来字母......
这个运行良好:
json = @{
"contactID"= "my id";
"text" = "היי";
}
Invoke-WebRequest -Uri http://localhost:8880/messages/send/text -Method POST -ContentType 'application/json' -Body $json
这是用问号替换希伯来字符:
$json = @"
{
"contactID" : "$($LastMessage.key.remoteJid)",
"quotedMessage": {
"key": {
"remoteJid": "$($LastMessage.participant)",
"id": "c"
},
"message": { "conversation": "$($LastMessage.message.conversation)" }
},
"text": "היי"
}
"@
Invoke-WebRequest -Uri http://localhost:8880/messages/send/text -Method POST -ContentType 'application/json' -Body $json
有什么选择可以在不破坏希伯来字母的情况下使用第二个?尝试了几种将其转换为UTF8的方法,但它根本没有帮助,只是制作带有黑色背景的问号。
我将不胜感激。