Last active
September 23, 2021 15:47
-
-
Save yehara/9339588 to your computer and use it in GitHub Desktop.
Google Apps Script から multipart/form-data でファイルを送信する(2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function request () { | |
var encodedFilename = "=?UTF-8?B?" + Utilities.base64Encode("ファイル名.csv", Utilities.Charset.UTF_8) + "?="; | |
var payload = { | |
"processModelInfoId": "1", | |
"nodeNumber": "1", | |
"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | |
"title": "件名をここに", | |
"data[0].upload": Utilities.newBlob("ファイル本文をここに", "text/csv; charset=UTF-8", encodedFilename) | |
}; | |
var options = { | |
"method" : "post", | |
"payload" : payload | |
}; | |
UrlFetchApp.fetch("https://YYYYYYYY.questetra.net/System/Event/MessageStart/start", options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment