File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ var request = require('request'),
100
100
// Set Defaults
101
101
options . method = options . method || 'GET' ;
102
102
options . requestId = requestId ;
103
- if ( options . method !== 'GET ') {
103
+ if ( options . method === 'POST ') {
104
104
// It's not a GET so we need something to push
105
105
if ( ! options . parameters ) {
106
106
throw new Error ( 'when using POST: options.parameters is required' ) ;
@@ -211,7 +211,9 @@ var request = require('request'),
211
211
part . data = parser . parseResponse ( part . data . toString ( ) ) ;
212
212
213
213
// Parse response JSON
214
- part . data . body = JSON . parse ( part . data . body ) ;
214
+ if ( part . data . body ) {
215
+ part . data . body = JSON . parse ( part . data . body ) ;
216
+ }
215
217
216
218
// Get the response id if exists
217
219
var returnedContentId = part . header [ 'content-id' ] ,
You can’t perform that action at this time.
0 commit comments