我们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;
}