Skip to content

Commit

Permalink
Adding support for specifying an encoding for the response body.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeal committed Jan 21, 2011
1 parent f796da7 commit dead30e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.js
Expand Up @@ -77,6 +77,7 @@ function request (options, callback) {
options.request = options.client.request(options.method, options.fullpath, options.headers);
options.request.addListener("response", function (response) {
var buffer;
if (options.encoding) response.setEncoding(options.encoding);
if (options.responseBodyStream) {
buffer = options.responseBodyStream;
sys.pump(response, options.responseBodyStream);
Expand Down

0 comments on commit dead30e

Please sign in to comment.