我需要能够flickr使用帐户用户名和密码将用户登录到我们的帐户。
我已经在网上搜索了很长一段时间,但只找到了一个实现的点点滴滴。我根本没有使用 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 需要哪些参数才能登录“你”。
欢迎任何建议