From b9ba04feccac0d44dc424275c3f58d090c539a15 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Fri, 25 Mar 2022 19:40:13 +0700 Subject: [PATCH] Fix #2 Cannot read append --- src/rest/APIRequest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rest/APIRequest.js b/src/rest/APIRequest.js index d560008..73e2cca 100644 --- a/src/rest/APIRequest.js +++ b/src/rest/APIRequest.js @@ -67,6 +67,7 @@ class APIRequest { body = JSON.stringify(this.options.data); headers['Content-Type'] = 'application/json'; } else if (this.options.body != null) { + body = new FormData(); body.append('payload_json', JSON.stringify(this.options.body)); headers = Object.assign(headers, body.getHeaders()); }