我需要能夠使用帳戶用戶名和密碼將用戶登錄到我們的flickr
帳戶。使用HttpWebRequest登錄到flickr的示例代碼(C#)
我一直在網上搜索了很長一段時間,但只發現了一個實現的點點滴滴。我根本沒有經驗過Http調用。我需要一個完整的例子。這是我的代碼至今:
HttpWebRequest http = WebRequest.Create(url) as HttpWebRequest;
http.Method = "POST";
http.ContentType = "application/x-www-form-urlencoded";
string postData = "FormNameForUserId=" + username + "&FormNameForPassword=" + password;
byte[] dataBytes = UTF8Encoding.UTF8.GetBytes(postData);
http.ContentLength = dataBytes.Length;
using (Stream postStream = http.GetRequestStream())
{
postStream.Write(dataBytes, 0, dataBytes.Length);
}
HttpWebResponse httpResponse = http.GetResponse() as HttpWebResponse;
我在這一點上我想是搞清楚什麼所有參數都Flickr的主要問題,需要在「您」登錄
任何建議,歡迎