diff options
author | Elmer Thomas <elmer@thinkingserious.com> | 2016-11-30 14:28:40 -0800 |
---|---|---|
committer | Elmer Thomas <elmer@thinkingserious.com> | 2016-11-30 14:28:40 -0800 |
commit | 89f5252c13026a4ae8ab1da62be6b743a01bf665 (patch) | |
tree | daac1edeadeb95ea51aa40d78896f5bc02890e62 /examples/browsers/browsers.cs | |
parent | 80f6dc4d8e0ac2caa211560f7ae6a2418e4e310d (diff) | |
download | sendgrid-csharp-89f5252c13026a4ae8ab1da62be6b743a01bf665.zip sendgrid-csharp-89f5252c13026a4ae8ab1da62be6b743a01bf665.tar.gz sendgrid-csharp-89f5252c13026a4ae8ab1da62be6b743a01bf665.tar.bz2 |
Updating documenation, Remove System.Web dependency
Diffstat (limited to 'examples/browsers/browsers.cs')
-rw-r--r-- | examples/browsers/browsers.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/browsers/browsers.cs b/examples/browsers/browsers.cs index e47ac92..5356c48 100644 --- a/examples/browsers/browsers.cs +++ b/examples/browsers/browsers.cs @@ -1,9 +1,10 @@ using System; +using SendGrid; using SendGrid.Helpers.Mail; // If you are using the Mail Helper using Newtonsoft.Json; // You can generate your JSON string yourelf or with another library if you prefer -string _apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User); -dynamic sg = new SendGrid.SendGridAPIClient(_apiKey); +string apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User); +Client client = new Client(apiKey); //////////////////////////////////////////////////////// // Retrieve email statistics by browser. @@ -17,7 +18,7 @@ string queryParams = @"{ 'offset': 'test_string', 'start_date': '2016-01-01' }"; -dynamic response = await sg.client.browsers.stats.get(queryParams: queryParams); +Response response = await client.RequestAsync(method: Client.Methods.GET, urlPath: "browsers/stats", queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.Body.ReadAsStringAsync().Result); Console.WriteLine(response.Headers.ToString()); |