WindowsにWampサーバーがあります。SSLが正しく構成されています。ブラウザでは、https:をスローして動作しています。スクリプトtest.phpがあり、POSTデータをダウンロードしてアップロードしたいと思います。私は私のc#コードを持っています:
WebClient client = new WebClient();
client.Encoding = Encoding.UTF8;
NameValueCollection values = new NameValueCollection();
values.Add("paramtest", "testval");
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
byte[] result;
result = client.UploadValues("https://127.0.0.1./test.php", "POST", values);
string htmlCode = Encoding.UTF8.GetString(result);
textBox1.Text = htmlCode;
このコードをhttpで実行すると、すべてのデータが取得されました。httpsを入力すると、サーバーからエラーが発生しました。
400不正な要求
要求の形式が正しくありません
ブラウザが、このサーバーが理解できないリクエストを送信しました。
どうすれば修正できますか?