Example #1
0
        public void DeleteTagTest()
        {
            var requestSet = new TagSetRequest
                (
                "TAG_TEST_DELETE"
                );

            Console.WriteLine("Set Tag:" + requestSet.Tag);

            var clientSet = new Client(_apiKey, _secretKey);
            var responseSet = clientSet.SetTag(requestSet);

            Assert.NotNull(responseSet);
            Assert.Greater(responseSet.RequestId, 0);

            var request = new TagDeleteRequest
                (
                "TAG_TEST_DELETE"
                );

            Console.WriteLine("Set Tag:" + requestSet.Tag);

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

            Assert.NotNull(response);
            Assert.Greater(response.RequestId, 0);
        }
Example #2
0
        /// <summary>
        /// set_tag
        /// </summary>
        /// <param name="request">set tag request parameter</param>
        /// <returns></returns>
        public TagSetResponse SetTag(TagSetRequest request)
        {
            var postStr = request.GeneratePostData(Apikey, SecretKey);

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

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