我们在下面的课程中提到了http post方法
public static class Http
{
public static byte[] Post(string uri, NameValueCollection pairs)
{
byte[] response = null;
using (WebClient client = new WebClient())
{
response = client.UploadValues(uri, pairs);
}
return response;
}
}
我们正在尝试登录但无法登录, 请参阅下面提到的post方法及其参数。
var response = Http.Post("https://test.com/login.shtml", new NameValueCollection() {
{ "accountname", "XXXX" },
{ "username", "XXXX" },
{ "password", "XXXX" },
});