static async Task<HttpResponseMessage> GetResponse(TicketUsageRequests ticket, string apiUrl) { HttpResponseMessage response = await client.PostAsJsonAsync(apiUrl, ticket); //response.EnsureSuccessStatusCode(); return response; }My question is - how can I get its result in the main method code and synchronously?
try { SetRequestHeaders(tcHost, tcUserName, tcPassword, tnTimeout, tnRetries); TicketUsageRequests ticket = new TicketUsageRequests(); ticket.TicketBarcode = tcBarcode; ticket.TicketUsageDate = tcUsageDate; ticket.UserID = tcUserName; ... here I want to get the result of the response and parse it ...I found this