diff options
author | Elmer Thomas <elmer@ThinkingSerious.com> | 2016-11-30 14:42:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-30 14:42:04 -0800 |
commit | 3131327a73273df4485a26de5ad4ec645918f8b3 (patch) | |
tree | daac1edeadeb95ea51aa40d78896f5bc02890e62 /examples/scopes/scopes.cs | |
parent | 9a5dbe23a2ccd57316cb8f8d57c7c51d67cc7ca3 (diff) | |
parent | 89f5252c13026a4ae8ab1da62be6b743a01bf665 (diff) | |
download | sendgrid-csharp-3131327a73273df4485a26de5ad4ec645918f8b3.zip sendgrid-csharp-3131327a73273df4485a26de5ad4ec645918f8b3.tar.gz sendgrid-csharp-3131327a73273df4485a26de5ad4ec645918f8b3.tar.bz2 |
Merge pull request #356 from sendgrid/remove-dynamic
Initial removal of dynamic with some Client refactoring
Diffstat (limited to 'examples/scopes/scopes.cs')
-rw-r--r-- | examples/scopes/scopes.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/scopes/scopes.cs b/examples/scopes/scopes.cs index b58b785..ac1c40e 100644 --- a/examples/scopes/scopes.cs +++ b/examples/scopes/scopes.cs @@ -1,15 +1,16 @@ 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 a list of scopes for which this user has access. // GET /scopes -dynamic response = await sg.client.scopes.get(); +Response response = await client.RequestAsync(method: Client.Methods.GET, urlPath: "scopes"); Console.WriteLine(response.StatusCode); Console.WriteLine(response.Body.ReadAsStringAsync().Result); Console.WriteLine(response.Headers.ToString()); |