Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/restler.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function Request(uri, options) {
// set port and method defaults
if (!this.url.port) this.url.port = (this.url.protocol == 'https:') ? '443' : '80';
if (!this.options.method) this.options.method = (this.options.data) ? 'POST' : 'GET';
if (this.options.method === 'GET') delete this.options.data;
if (typeof this.options.followRedirects == 'undefined') this.options.followRedirects = true;

// stringify query given in options of not given in URL
Expand Down
7 changes: 7 additions & 0 deletions test/restler.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,13 @@ module.exports['Content-Length'] = {
test.equal(0, data, 'should set content-length');
test.done();
});
},

'GET content length': function (test) {
rest.get(host).on('complete', function(data) {
test.equal(0, data, 'should be zero content-length');
test.done();
});
}

};
Expand Down