c# - 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); }
解决方案
推荐阅读
- ios - 如何使用 swift 4.2 在泛型类中创建单例?
- c++ - 一个使用 QtUdpSocket 的简单通信 c/s 应用程序
- android - 反应原生滚动视图不在android上滚动
- laravel - 如何在 laravel 5.7 中从 mandrill 获得邮件回复?
- android - 我无法使用 setDataSource 播放媒体文件
- c# - 如何在每一页上为表格的第一行应用相同的格式?
- python - 在 Python 中加载两个动态库实例
- javascript - 如何使用来自rest api json的jQuery Datatable插件?
- python - 尝试使用 VGG16 模型进行训练时出现“检查目标时出错”消息
- python - 通过给定的平稳向量计算马尔可夫链