From 6c820f71a68633dfa7faa51ec58fef99a1a994cf Mon Sep 17 00:00:00 2001 From: JP Richardson Date: Fri, 8 Apr 2016 09:37:24 -0500 Subject: [PATCH] (Closes #2) fix browser version --- dist/shapeshift.js | 4 ++-- lib/http/http-browser.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/shapeshift.js b/dist/shapeshift.js index 270e808..a956adb 100644 --- a/dist/shapeshift.js +++ b/dist/shapeshift.js @@ -2,7 +2,7 @@ var xhr = require('xhr') function get (url, callback) { - xhr({ method: 'GET', url: url, json: true, timeout: 30000 }, function (err, resp, body) { + xhr({ method: 'GET', url: url, json: undefined, timeout: 30000 }, function (err, resp, body) { if (err) return callback(err) if (resp.statusCode !== 200) return callback(new Error('HTTP status code: ' + resp.statusCode)) callback(null, body) @@ -10,7 +10,7 @@ function get (url, callback) { } function post (url, data, callback) { - xhr({ method: 'GET', url: url, json: true, timeout: 30000, data: data }, function (err, resp, body) { + xhr({ method: 'POST', url: url, json: data, timeout: 30000 }, function (err, resp, body) { if (err) return callback(err) if (resp.statusCode !== 200) return callback(new Error('HTTP status code: ' + resp.statusCode)) callback(null, body) diff --git a/lib/http/http-browser.js b/lib/http/http-browser.js index 2936f03..c26968c 100644 --- a/lib/http/http-browser.js +++ b/lib/http/http-browser.js @@ -1,7 +1,7 @@ var xhr = require('xhr') function get (url, callback) { - xhr({ method: 'GET', url: url, json: true, timeout: 30000 }, function (err, resp, body) { + xhr({ method: 'GET', url: url, json: undefined, timeout: 30000 }, function (err, resp, body) { if (err) return callback(err) if (resp.statusCode !== 200) return callback(new Error('HTTP status code: ' + resp.statusCode)) callback(null, body) @@ -9,7 +9,7 @@ function get (url, callback) { } function post (url, data, callback) { - xhr({ method: 'GET', url: url, json: true, timeout: 30000, data: data }, function (err, resp, body) { + xhr({ method: 'POST', url: url, json: data, timeout: 30000 }, function (err, resp, body) { if (err) return callback(err) if (resp.statusCode !== 200) return callback(new Error('HTTP status code: ' + resp.statusCode)) callback(null, body)