这是我的代码:
var request = require('request');
var j = request.jar();
request = request.defaults({jar:j, followAllRedirects: true});
var urls =new Array();
urls["login"] = "https://www.brooklynfitzone.com/index.php/login";
urls["main"] = "https://www.brooklynfitzone.com/index.php";
urls["reserva"] = "https://www.brooklynfitzone.com/index.php/classes/set_book";
//login
request.post(urls["login"], {form:{user:'user@user.com',pass:'testpass'}}, function(err, httpResponse, html) {
console.log(httpResponse);
console.log(j.getCookies());
console.log(err);
console.log(html);
});
问题是,使用正确的用户和密码,它返回的正文是空的,我无法获取任何内容。