C# WebClient UploadValues 卡住

问题描述

我正在尝试在 API 上发布数据但看起来它卡在 Amazon Cloud Windows 机器上的 webClient.UploadValues 行上,它在本地 Windows 计算机上运行良好,但在 AWS Windows 机器上它卡住了,是否有不同的架构或在 AWS Windows 机器上运行它所需的任何其他设置。

  foreach  (string filename in filePaths)
            {
                string payload = System.IO.File.ReadAllText(filename);
                using (WebClient webClient = new System.Net.WebClient())
                {
                    var _postParams = new System.Collections.Specialized.NameValueCollection();
                    webClient.Headers.Add("headertoken",Common._WebAPIKey);
                    byte[] responseByes = webClient.UploadValues(Common._APIURL,"POST",payload);
                    _returnValue = Encoding.UTF8.GetString(responseByes);
                }
                _filename = filename;
                System.IO.File.Delete(filename);                    
            }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)