summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Transport/Web.cs
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2013-07-28 09:45:50 -0600
committerBrandon West <brawest@gmail.com>2013-07-29 09:28:31 -0600
commit4dcaadf78b12723609c3b173ec6d6140d0db855d (patch)
tree01ff00b2fbc4158d9c2471b6989bdd607eb18556 /SendGrid/SendGridMail/Transport/Web.cs
parent983c867b29df1ddc66556411071d73f39bd8a675 (diff)
downloadsendgrid-csharp-4dcaadf78b12723609c3b173ec6d6140d0db855d.zip
sendgrid-csharp-4dcaadf78b12723609c3b173ec6d6140d0db855d.tar.gz
sendgrid-csharp-4dcaadf78b12723609c3b173ec6d6140d0db855d.tar.bz2
Revert "make Deliver and CheckForErrors methods async"
This reverts commit 7d436f6cb48b1fe8f12949fea77bb7ea87fe3cc3.
Diffstat (limited to 'SendGrid/SendGridMail/Transport/Web.cs')
-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))
{