query_bindlist 请求参数
Inheritance: ClientRequestBase
コード例 #1
0
ファイル: BindTests.cs プロジェクト: JiyongShi/Baidu.SDK.Push
        public void QueryBindTest()
        {
            var request = new BindListQueryRequest();
            //request.ChannelId = 3789323588078526627;

            var client = new Client(_apiKey, _secretKey);
            var response = client.QueryBindList(request);

            Assert.NotNull(response);
            Assert.Greater(response.RequestId, 0);
            Assert.NotNull(response.ResponseParams);
            //Assert.Greater(response.ResponseParams.Amount, 0);
        }
コード例 #2
0
ファイル: Client.cs プロジェクト: BiYiTuan/Baidu.SDK.Push
        /// <summary>
        /// Query Binds
        /// </summary>
        /// <param name="request">Query Binds request parameter</param>
        /// <returns></returns>
        public BindListQueryResponse QueryBindList(BindListQueryRequest request)
        {
            var postStr = request.GeneratePostData(Apikey, SecretKey);

            var response = PostData(request.ServiceUrl, postStr);
            if (response == null)
                return null;

            BindListQueryResponse result = null;
            try
            {
                var serializerSettings = new JsonSerializerSettings();
                serializerSettings.Converters.Add(new UnixDateTimeConverter());

                result = JsonConvert.DeserializeObject<BindListQueryResponse>(response, serializerSettings);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("QueryBindList Error Response Deserialize Fail, May not valid json:" + ex.Message + " " + response);
            }
            return result;
        }