Skip to content

Commit

Permalink
solves #56
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Møller committed Dec 10, 2014
1 parent 0482cdb commit 90b935c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion restapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ function apiCall(_options, _callback) {
etag && xhr.setRequestHeader('IF-NONE-MATCH', etag);
}

xhr.send(_options.data || null);
if (_options.type != 'GET' && !_.isEmpty(_options.data)) {
xhr.send(_options.data);
} else {
xhr.send();
}
} else {
// we are offline
_callback({
Expand Down

0 comments on commit 90b935c

Please sign in to comment.