summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 5e7c2f5..2e32f47 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -48,7 +48,7 @@ namespace SendGridMail.Transport
/// Delivers a message over SendGrid's Web interface
/// </summary>
/// <param name="message"></param>
- public async void Deliver(ISendGrid message)
+ public void Deliver(ISendGrid message)
{
var client = new HttpClient
{
@@ -58,7 +58,7 @@ namespace SendGridMail.Transport
var content = new MultipartFormDataContent();
AttachFormParams(message, content);
AttachFiles(message, content);
- var response = await client.PostAsync(Endpoint + ".xml", content);
+ var response = client.PostAsync(Endpoint + ".xml", content).Result;
CheckForErrors(response);
}
@@ -107,7 +107,7 @@ namespace SendGridMail.Transport
}
}
- private async void CheckForErrors (HttpResponseMessage response)
+ private void CheckForErrors (HttpResponseMessage response)
{
//transport error
if (response.StatusCode != HttpStatusCode.OK) {
@@ -115,7 +115,7 @@ namespace SendGridMail.Transport
}
//TODO: check for HTTP errors... don't throw exceptions just pass info along?
- var content = await response.Content.ReadAsStreamAsync();
+ var content = response.Content.ReadAsStreamAsync().Result;
using (var reader = XmlReader.Create(content))
{