suitescript2.0

In NetSuite with SuiteScript 2.0 unable to send a file with HTTP POST request with a content-type multipart/form-data

♀尐吖头ヾ 提交于 2019-12-03 05:04:05
I am not able to send my "multipart/form-data' file to this API. If I use POSTMAN it's working but with the https post method it seems that netsuite doesn't recognize the "form-data" content-type. Somebody knows how to send a form-data with SuiteScript 2 ? Here is a part of my code: var fileObj = file.create({ name: invoiceNumber + '_ubl.xml', fileType: file.Type.XMLDOC, contents: einvoicecontentwithpdf, folder : 120, isOnline : false }); var headers = { 'Authorization': 'Basic xxxxxxxxxxxxxxxxxxxxx', 'Content-Type': 'multipart/form-data' }; var response = https.post({ url: 'https://community