예제 #1
0
        private async Task PerformAttributeAction(Ticket ticket, UserName user, string attributeName, object value, UserAttributeAction action)
        {
            try
            {
                var request = HttpHelper.CreateHttpRequest(GetRequestUri("/PutUserAttribute"), RequestMethod.Put);

                var postParameters = new List <BodyParameter>
                {
                    new BodyParameter("ticket", ticket),
                    new BodyParameter("user", user),
                    new BodyParameter("attributeName", attributeName),
                    new BodyParameter("action", (int)action),
                    new BodyParameter("attributeData", UserAttribute.Create(value))
                };

                await request.WritePostParameters(postParameters.ToArray());

                await request.GetResponseData();
            }
            catch (WebException ex)
            {
                throw GetServiceException(ex);
            }
        }