2016-09-25 176 views
0

我試圖訪問Twitter用戶的followers頁面,但該內容不適用於訪客。授權HttpClient請求

using (var res = await http.GetAsync("http://www.twitter.com/" + handle + "/followers")) 
{ 
    followers = new List<string>(); 
    ... 
    // res returns a login page 

有什麼簡單的方法來授權我的請求在ASP.NET中?我可以以某種方式使用向我的ASP.NET頁面發送請求的客戶端的Cookie?

好的,這是一個愚蠢的想法。還有什麼可以工作嗎?

回答

0

我不喜歡這樣寫道:

var authenticationCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName]; 

,然後使用authenticationCookie傳召用戶的API。

+0

好的,但這應該如何授權Twitter帳戶? – Reynevan