summaryrefslogtreecommitdiffstats
path: root/SendGrid/SendGridMail/Transport/Web.cs
diff options
context:
space:
mode:
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);