首页 > 解决方案 > 无法使用 .NET API v2.0 在 VZAAR 上上传视频?

问题描述

我们VZAAR订阅了上传/观看视频。VZAAR最近更改了与AWS S3连接的 API 。他们的 .NET API 不起作用,我们面临以下错误:

"HttpSendAsync"当我们调用类的方法时,网页一直在加载"Client.cs"

执行的最后一段代码是:

HttpResponseMessage response = await this.httpClient.SendAsync (msg);

下面提供了完整的代码。

VZAAR'sweb界面提供了一些在线测试方法,效果很好,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#.netapivideo-uploadvzaar-api

解决方案


推荐阅读