2013-07-20 92 views

回答

1

它使用了一個asp.net會話cookie。您可能需要將所有Cookie存儲在jar中,然後在下一個請求中發回。

+0

可以請你給我提供的如何做一個樣本那?我會很好 –

+1

https://github.com/mikeal/request#examples – AndyD

0

您好我解決了這個用罐子參數要求:

var j = request.jar(); 
    var request = request.defaults({ jar : j }) //it will make the session default for every request 
    //... 
    request({ 
     url:"https://www.erobertparker.com/login.aspx", 
     method:"POST", 
     form:{UNENTRY:"username",PWENTRY:"password"} 
    }, 
    function(error,response,body){ 
     //Do your logic here or even another request like 
     request({ 
      url:"<ANOTHER LINK>", 
      method:"GET", 
     }, function(error, response, body){ 
      //Some logic 
     }); 
    }); 

您還可以檢查請求模塊的文檔: https://github.com/request/request#examples