summaryrefslogtreecommitdiffstats
path: root/SendGrid
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2015-04-22 08:59:31 -0600
committerBrandon West <brawest@gmail.com>2015-04-22 08:59:31 -0600
commit97bcb9854b8c8d3796b7b1dd56d2525fc8832057 (patch)
tree841916d8772c6285815f8d44e319928ef89d8df8 /SendGrid
parent45bb4039dd6be64a3a5c31667ffcf83bb5181635 (diff)
downloadsendgrid-csharp-97bcb9854b8c8d3796b7b1dd56d2525fc8832057.zip
sendgrid-csharp-97bcb9854b8c8d3796b7b1dd56d2525fc8832057.tar.gz
sendgrid-csharp-97bcb9854b8c8d3796b7b1dd56d2525fc8832057.tar.bz2
remove synchronous deliver()
Diffstat (limited to 'SendGrid')
-rw-r--r--SendGrid/SendGridMail/Transport/ITransport.cs7
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs22
2 files changed, 2 insertions, 27 deletions
diff --git a/SendGrid/SendGridMail/Transport/ITransport.cs b/SendGrid/SendGridMail/Transport/ITransport.cs
index 26ea635..94a2d7f 100644
--- a/SendGrid/SendGridMail/Transport/ITransport.cs
+++ b/SendGrid/SendGridMail/Transport/ITransport.cs
@@ -9,13 +9,6 @@ namespace SendGrid
/// </summary>
public interface ITransport
{
- /// <summary>
- /// Delivers a message using the protocol of the derived class
- /// </summary>
- /// <param name="message">the message to be delivered</param>
- void Deliver(ISendGrid message);
-
-
/// <summary>
/// Asynchronously delivers a message using the protocol of the derived class
/// </summary>
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 2d1cb0f..58f54ee 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -19,7 +19,7 @@ namespace SendGrid
#region Properties
//TODO: Make this configurable
- public const String Endpoint = "https://api.sendgrid.com/api/mail.send";
+ public const String Endpoint = "https://api.sendgrid.com/api/mail.send.xml";
private readonly NetworkCredential _credentials;
private readonly TimeSpan _timeout;
@@ -48,24 +48,6 @@ namespace SendGrid
}
/// <summary>
- /// Delivers a message over SendGrid's Web interface
- /// </summary>
- /// <param name="message"></param>
- public void Deliver(ISendGrid message)
- {
- var client = new HttpClient();
-
- var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
- client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "sendgrid/" + version + ";csharp");
-
- var content = new MultipartFormDataContent();
- AttachFormParams(message, content);
- AttachFiles(message, content);
- var response = client.PostAsync(Endpoint + ".xml", content).Result;
- CheckForErrors(response);
- }
-
- /// <summary>
/// Asynchronously delivers a message over SendGrid's Web interface
/// </summary>
/// <param name="message"></param>
@@ -80,7 +62,7 @@ namespace SendGrid
var content = new MultipartFormDataContent();
AttachFormParams(message, content);
AttachFiles(message, content);
- var response = await client.PostAsync(Endpoint + ".xml", content);
+ var response = await client.PostAsync(Endpoint, content);
await CheckForErrorsAsync(response);
}