Пример #1
0
        private static async Task TestTicketSalesApi()
        {
            _consoleHelper.OutputTime();

            TicketInformation ticketInformation = CreateTestTicketInformation();
            var result = await CallOrderTicket(ticketInformation);

            _consoleHelper.OutputTime();
        }
Пример #2
0
        private static async Task <bool> CallOrderTicket(TicketInformation ticketInformation)
        {
            var json = JsonConvert.SerializeObject(ticketInformation);
            var data = new StringContent(json, Encoding.UTF8, "application/json");

            HttpResponseMessage response = await client.PostAsync(
                $"{_ticketSalesApiPath}/orderticket", data);

            return(response.IsSuccessStatusCode);
        }