Пример #1
0
        protected override IRestRequest GetRequestObject()
        {
            var request = new RestRequest(Method.POST) {RequestFormat = DataFormat.Json};
            var wrapper = new EventEntry
                {
                    EventType = new EventType {Name = Event},
                    Machine = new Machine { MachineId = Machine },
                    Session = new Session {SessionGuid = Session},
                    User = new User {Username = User},
                    Text = Message
                };
            request.AddBody(wrapper);

            return request;
        }
Пример #2
0
        internal override IRestRequest GetRequestObject(string eventId, string message)
        {
            var entry = new EventEntry
            {
                EventType = new EventType { Name = eventId },
                Machine = new Machine { MachineId = MachineId },
                User = new User { Username = UserId },
                Session = new Session { SessionGuid = Session },
                Text = message

            };

            var request = new RestRequest(Method.POST) { RequestFormat = DataFormat.Json };
            request.AddBody(entry);

            return request;
        }