var request = require("request");
//登陆
//$.ajax({
//    url: "https://www.chandashi.com/user/login.html",
//    data: {username:'longames@qq.com',password:"danqing1997"},
//    type: "POST",
//    success: function (result) {
//        console.log(result);
//    }
//});

function login(cb) {
    var data = {username:'longames@qq.com',password:"danqing1997"};
    request({
        url: "https://www.chandashi.com/user/login.html",
        method: "POST",
        headers: {
            "Content-type": "application/json"
        },
        formData: data
    }, function(error, response, body){
        console.log(error, body);
        console.log("cookie: " + response.headers["set-cookie"])
    });
}

login();