Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 通过HTTPS使用WebClient发送请求-发布日期加倍_C#_Post_Https_Webclient - Fatal编程技术网

C# 通过HTTPS使用WebClient发送请求-发布日期加倍

C# 通过HTTPS使用WebClient发送请求-发布日期加倍,c#,post,https,webclient,C#,Post,Https,Webclient,此代码 using (WebClient webClient = new WebClient()) { string address = "https://www.any.com/name.htm"; byte[] postData = Encoding.ASCII.GetBytes("login=123"); webClient.Headers[HttpRequestHeader.Accep

此代码

        using (WebClient webClient = new WebClient())
        {
            string address = "https://www.any.com/name.htm";
            byte[] postData = Encoding.ASCII.GetBytes("login=123");
            webClient.Headers[HttpRequestHeader.Accept] = "text/html, application/xhtml+xml, */*";
            webClient.Headers[HttpRequestHeader.AcceptLanguage] = "ru-RU";
            webClient.Headers[HttpRequestHeader.UserAgent] = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
            webClient.Headers[HttpRequestHeader.AcceptEncoding] = "gzip, deflate";
            webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            webClient.UploadData(address, postData);
        }
生成此请求(postData加倍):

如果我改变

string address = "https://www.any.com/name.htm"

那么数据就不会加倍


通过HTTPS发送请求时如何避免数据加倍?

这是HttpAnalizer的错误。


非常感谢Hardrada。

我刚刚使用Fiddler2进行了一次测试,它没有复制数据。听起来问题出在其他地方。我看到了HttpAnalizer6的请求主体。可能这是HttpAnalizer的错误…这是可能的。你可以试试Fiddler2,看看结果如何,以便进行比较。@Hardrada会发布答案并获得声誉吗?答案和评论不一样。a+1用于指导OP找到解决方案的注释并非断章取义。
string address = "https://www.any.com/name.htm"
string address = "http://www.any.com/name.htm"