I want to use superagent to request this interfacehttp://hq.sinajs.cn/list=sh600138
. How can I output the returned data on the console? Masters, I am still on it. Kindergarten please answer
黄舟2017-06-19 09:09:53
I took a look at your interface, because Content-Type:application/x-javascript; charset=GBK
is not a buffer type, so it cannot be parsed directly, just convert it to buffer.
const request = require('superagent');
request
.get('http://hq.sinajs.cn/list=sh600138')
.buffer(true)
.end((err, res) => {
console.log(res.text);
});