diff --git a/lib/restler.js b/lib/restler.js index 715845a..3ae30d5 100644 --- a/lib/restler.js +++ b/lib/restler.js @@ -56,8 +56,10 @@ function Request(uri, options) { } } else { if (typeof this.options.data == 'object') { - this.options.data = qs.stringify(this.options.data); - this.headers['Content-Type'] = 'application/x-www-form-urlencoded'; + if (!(this.options.data instanceof Buffer)) { + this.options.data = qs.stringify(this.options.data); + this.headers['Content-Type'] = 'application/x-www-form-urlencoded'; + } this.headers['Content-Length'] = this.options.data.length; } if (typeof this.options.data == 'string') {