c# - 无法使用 .NET API v2.0 在 VZAAR 上上传视频?
问题描述
我们VZAAR
订阅了上传/观看视频。VZAAR
最近更改了与AWS S3连接的 API 。他们的 .NET API 不起作用,我们面临以下错误:
"HttpSendAsync"
当我们调用类的方法时,网页一直在加载"Client.cs"
。
执行的最后一段代码是:
HttpResponseMessage response = await this.httpClient.SendAsync (msg);
下面提供了完整的代码。
VZAAR's
web界面提供了一些在线测试方法,效果很好,VZAAR
支持推荐使用我们不知道的PHP。
internal async virtual Task<string> HttpSendAsync(HttpRequestMessage msg) {
if (CfgUrlAuth == true) {
Dictionary<string, string> query = new Dictionary<string, string> ();
query.Add ("client_id", client_id);
query.Add ("auth_token", auth_token);
Uri uri = BuildQuery (msg.RequestUri, query);
msg.RequestUri = uri;
} else {
msg.Headers.Add ("X-Client-Id", client_id);
msg.Headers.Add ("X-Auth-Token", auth_token);
}
#if DEBUG
Debug.WriteLine ("\n\nRequest Method");
Debug.WriteLine (msg.Method.ToString());
Debug.WriteLine ("Request Uri");
Debug.WriteLine (msg.RequestUri.AbsoluteUri);
Debug.WriteLine ("Request Headers");
Debug.WriteLine (msg.Headers.ToString().Trim());
if (msg.Content != null) {
Debug.WriteLine ("Request Content");
string debug_content = await msg.Content.ReadAsStringAsync ();
Debug.WriteLine (debug_content);
}
#endif
HttpResponseMessage response = await this.httpClient.SendAsync (msg);
ValidateHttpResponse (response);
httpHeaders = response.Headers;
var bodyResponse = await response.Content.ReadAsStringAsync ();
return bodyResponse;
}
解决方案
推荐阅读
- c++ - 如何在野兽中重用 http::response
- angular - 响应式 highchart 仪表
- sql - SQL Server - 使用临时表优化存储过程
- node.js - 如何检测副本集的 MongoDB 重新连接
- mongodb - MongoDB在同一键中查找具有多个条件的嵌套子文档
- python - 计算跨数据帧的重叠时间间隔
- python - 我如何使用 tkinter 在 selenium 中使用变量
- javac - TreeMaker 如何编写返回空语句
- python - 如何使用 Python 平滑轮廓
- excel - 通过 Powershell 使用自定义颜色填充 Excel 单元格