summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail
diff options
context:
space:
mode:
authorbrandonmwest <brawest@gmail.com>2014-01-03 08:30:50 -0800
committerbrandonmwest <brawest@gmail.com>2014-01-03 08:30:50 -0800
commit55a1b3617f8c131d4715c8a27aaf258fe8af0bf7 (patch)
tree46340dd7c023e6bb73d35ead82649b9fe41d75c4 /SendGrid/SendGridMail
parenta408a6567a21dbdd59403b769143477c4dbea6c4 (diff)
parent70f18f85a5d97a7d6ef8a7863a75b09d953fe985 (diff)
downloadsendgrid-csharp-55a1b3617f8c131d4715c8a27aaf258fe8af0bf7.zip
sendgrid-csharp-55a1b3617f8c131d4715c8a27aaf258fe8af0bf7.tar.gz
sendgrid-csharp-55a1b3617f8c131d4715c8a27aaf258fe8af0bf7.tar.bz2
Merge pull request #38 from nufyoot/master
Make DeliverAsync awaitable
Diffstat (limited to 'SendGrid/SendGridMail')
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 49bceb7..0909e34 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -6,6 +6,7 @@ using System.Net;
using System.Net.Http.Headers;
using System.Xml;
using System.Net.Http;
+using System.Threading.Tasks;
namespace SendGridMail.Transport
{
@@ -64,7 +65,7 @@ namespace SendGridMail.Transport
/// Asynchronously delivers a message over SendGrid's Web interface
/// </summary>
/// <param name="message"></param>
- public async void DeliverAsync(ISendGrid message)
+ public async Task DeliverAsync(ISendGrid message)
{
var client = new HttpClient
{
@@ -75,7 +76,7 @@ namespace SendGridMail.Transport
AttachFormParams(message, content);
AttachFiles(message, content);
var response = await client.PostAsync(Endpoint + ".xml", content);
- CheckForErrorsAsync(response);
+ await CheckForErrorsAsync(response);
}
#region Support Methods
@@ -162,7 +163,7 @@ namespace SendGridMail.Transport
}
}
- private async void CheckForErrorsAsync(HttpResponseMessage response)
+ private async Task CheckForErrorsAsync(HttpResponseMessage response)
{
//transport error
if (response.StatusCode != HttpStatusCode.OK)