我正在尝试调用从谷歌应用脚本发送短信的服务。该服务需要 iso 8859-1 中的数据。下面的代码发送一条带有 åäö 作为坏字符的消息。
function sendSMS() {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var cell = doc.getRange('b8');
var payload =
{
"username" : "XXXX",
"password" : "YYYY",
"nr" : "0123123123",
"type" : "text",
"data" : "Hello world...åäö"
};
var options =
{
"method" : "post",
"payload" : payload
};
var response = UrlFetchApp.fetch("http://www.mosms.com/se/sms-send.php", options);
Browser.msgBox(response.getContentText());
}
function testFetch (){
var response = UrlFetchApp.fetch("http://www.google.com/");
Browser.msgBox(response.getContentText());
}