From 7bde808305de14ffb5522ff5b7b9e95ada70dc01 Mon Sep 17 00:00:00 2001 From: danzelt Date: Thu, 19 Mar 2020 22:53:03 +0800 Subject: [PATCH] Added feature to support POST method when download is true Added new config property named downloadRequestBody --- papaparse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/papaparse.js b/papaparse.js index 58ba296..7380a88 100755 --- a/papaparse.js +++ b/papaparse.js @@ -642,7 +642,7 @@ License: MIT xhr.onerror = bindFunction(this._chunkError, this); } - xhr.open('GET', this._input, !IS_WORKER); + xhr.open(this._config.downloadRequestBody ? 'POST' : 'GET', this._input, !IS_WORKER); // Headers can only be set when once the request state is OPENED if (this._config.downloadRequestHeaders) { @@ -661,7 +661,7 @@ License: MIT } try { - xhr.send(); + xhr.send(this._config.downloadRequestBody); } catch (err) { this._chunkError(err.message);