var request = require('request');
var url = 'http://pinterest.com';
request({
'method':'GET',
'url':url,
}, function(err, response, body){
});
当我点击这个时,我得到:
[TypeError: Cannot read property 'url' of undefined]
TypeError: Cannot read property 'url' of undefined
at new Cookie (/home/user/project/src/node_modules/request/vendor/cookie/indeprojectx.js:45:20)
at /home/user/project/src/node_modules/request/main.js:434:33
at Array.forEach (native)
at Request.<anonymous> (/home/user/project/src/node_modules/request/main.js:428:46)
at Request.emit (events.js:67:17)
at IncomingMessage.<anonymous> (/home/user/project/src/node_modules/request/main.js:393:16)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
at Socket.ondata (http.js:1137:24)user
注意:我在 EC2 上。出于某种原因,这不适用于 pinterest.com。它适用于 Google.com 和 yahoo.com。我可以 CURL pinterest.com 就好了。