diff --git a/model/WumpRequest.js b/model/WumpRequest.js index 73fe334..ec4e7be 100644 --- a/model/WumpRequest.js +++ b/model/WumpRequest.js @@ -151,13 +151,16 @@ module.exports = class WumpRequest { } req.on('error', (e) => reject(e)); - if (this.o.SDA === 'json') { - req.write(JSON.stringify(this.o.data)); - } else { - if (typeof this.o.data === 'object') { + + if (this.o.data) { + if (this.o.SDA === 'json') { req.write(JSON.stringify(this.o.data)); } else { - req.write(this.o.data); + if (typeof this.o.data === 'object') { + req.write(JSON.stringify(this.o.data)); + } else { + req.write(this.o.data); + } } } diff --git a/package.json b/package.json index 9b7a36b..c78b8ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wumpfetch", - "version": "0.1.1", + "version": "0.1.2", "description": "🚀 A lightweight and fast Node.js HTTP Client", "author": "Wessel \"wesselgame\" T ", "license": "MIT",