Skip to content

Instantly share code, notes, and snippets.

@popomore
Last active August 29, 2015 13:59
Show Gist options
  • Save popomore/10986324 to your computer and use it in GitHub Desktop.
Save popomore/10986324 to your computer and use it in GitHub Desktop.
输出是乱码
var urllib = require('urllib');
// 乱码
urllib.request('http://static.alipayobjects.com/build/js/arale.js', {}, function (err, data, res) {
console.log(data.toString());
});
// 正常
urllib.request('https://a.alipayobjects.com/build/js/arale.js', {}, function (err, data, res) {
console.log(data.toString());
});
@fengmk2
Copy link

fengmk2 commented Apr 17, 2014

urllib.request('http://static.alipayobjects.com/build/js/arale.js', {gzip:true}, function (err, data, res) {
  console.log(data.toString());
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment