I'm trying a SKY API example in a new Visual Studio 2017 console application (.net framework - 4.7.1). When I attempt do debug the application, all I get is "
The program '[25704] ConsoleApp1.exe' has exited with code 0 (0x0)". I'm expecting the application to wait for a response and eventually show me the response as the SKY Api [Try it!] page does. Can anyone tell me what I'm missing. Thanks
using System.Threading.Tasks;using System.Net.Http.Headers;using System.Net.Http;using System.Web;static void Main(string[] args){ MakeRequest();}static async void MakeRequest(){try{using (HttpClient client = new HttpClient()){var queryString = HttpUtility.ParseQueryString(string.Empty);client.DefaultRequestHeaders.Add("Bb-Api-Subscription-Key", "08538c8a0c16416eaf00axxxxxxxxxxxxxx");client.DefaultRequestHeaders.Add("Authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjREVjZzVkxIM0FtU1JTbUZqMk04Wm5wWHU3WSJ9.eyJuYW1laWQiOiI0ZTU0MGExMC03Y2IxLTQxZTYtYjNhYS0xMzUwMGYyYWMzODIiLCJhcHBsaWNhdGlvbmlkIjoiYTA1NmNhNmItYTNhOC00YWM3LWIzMjUtOTk3NjY2MzA2ZTUyIiwiZW52aXJvbm1lbnRpZCI6InAtSnEySFBfYlBUa3lMLWYzZzd2MFJhQSIsImVudmlyb25tZW50bmFtZSI6Ik1ITVIgb2YgVGFycmFudCBDb3VudHkgUHJvZHVjdGlvbiBFbnZpcm9ubWVudCIsImxlZ2FsZW50aXR5aWQiOiJwLUVnMnY3c0VONTBhcXdVN1VxOWpTWmciLCJsZWdhbGVudGl0eW5hbWUiOiJNSE1SIG9mIFRhcnJhbnQgQ291bnR5Iiwiem9uZSI6InAtdXNhMDEiLCJpc3MiOiJodHRwczovL29hdXRoMi5za3kuYmxhY2tiYXVkLmNvbS8iLCJhdWQiOiJibGFja2JhdWQiLCJleHAiOjE1Nzk2NDM1NDksIm5iZiI6MTU3OTYzOTk0OX0.aq1NAfqaFBrozJ3NGT5jRdfYCDrE3cavyge82gsuwfymqPHI7CwlTWYzA_imXNL1jYi62fwRUaD8DqzYXC7vguo3ZLjLjmGx9TmLKven7gCxDr4w_jPJe9q_AFgQmt9MVW6xKGaZKmmcFzE3TfL7n4vP4KvUER-FKPW5mQduy3-HeAgMFNJ3KALKV26acFAQOEhC6cjLmxldO2lSeEPK4xnN7ONdTEhW-cSbU4GhmPhCo7q-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");queryString["limit"] = "6";var _uri = "https://api.sky.blackbaud.com/generalledger/v1/journalentrybatches?" + queryString;var response = await client.GetAsync(_uri);}}catch (Exception ex){Console.WriteLine(ex.Message);}}