summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Transport/Web.cs
diff options
context:
space:
mode:
authorBrandon West <brawest@gmail.com>2013-07-27 08:31:29 -0600
committerBrandon West <brawest@gmail.com>2013-07-29 09:28:31 -0600
commit9c893aaf8adb6fd96de4547278cb6eecdd5d4fc5 (patch)
treeaafcd17733f121a8815c325c2a8800c93b578f64 /SendGrid/SendGridMail/Transport/Web.cs
parent88dae9a37133f10ac1e5a213bcac89aeee2ba30c (diff)
downloadsendgrid-csharp-9c893aaf8adb6fd96de4547278cb6eecdd5d4fc5.zip
sendgrid-csharp-9c893aaf8adb6fd96de4547278cb6eecdd5d4fc5.tar.gz
sendgrid-csharp-9c893aaf8adb6fd96de4547278cb6eecdd5d4fc5.tar.bz2
remove RestSharp dependency, add Web API dependency. unstable
Diffstat (limited to 'SendGrid/SendGridMail/Transport/Web.cs')
-rw-r--r--SendGrid/SendGridMail/Transport/Web.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/SendGrid/SendGridMail/Transport/Web.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 6ff89d5..be2c273 100644
--- a/SendGrid/SendGridMail/Transport/Web.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -4,8 +4,8 @@ using System.IO;
using System.Linq;
using System.Net;
using System.Text;
-using System.Xml;
-using RestSharp;
+using System.Xml;
+using System.Net.Http;
namespace SendGridMail.Transport
{
@@ -13,7 +13,7 @@ namespace SendGridMail.Transport
{
#region Properties
//TODO: Make this configurable
- public const String BaseURl = "sendgrid.com/api/";
+ public const String BaseURL = "sendgrid.com/api/";
public const String Endpoint = "mail.send";
public const String JsonFormat = "json";
public const String XmlFormat = "xml";
@@ -50,7 +50,8 @@ namespace SendGridMail.Transport
/// <param name="message"></param>
public void Deliver(ISendGrid message)
{
- var client = Https ? new RestClient("https://" + BaseURl) : new RestClient("http://" + BaseURl);
+ var client = new HttpClient();
+ var url = Https ? new Uri("https://" + BaseURL + Endpoint + ".xml") : new Uri("http://" + BaseURL + Endpoint + ".xml");
var request = new RestRequest(Endpoint + ".xml", Method.POST);
AttachFormParams(message, request);
AttachFiles(message, request);