From 9d82dcf950ca1c7c3eaeb70c5275c3925173c4e1 Mon Sep 17 00:00:00 2001 From: Andrew Edwards Date: Fri, 13 Apr 2018 07:31:17 -0400 Subject: [PATCH] Updates for http encoding. --- Sources/SendGrid/Models/SendGridClient.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/SendGrid/Models/SendGridClient.swift b/Sources/SendGrid/Models/SendGridClient.swift index 6df3429..30be12e 100644 --- a/Sources/SendGrid/Models/SendGridClient.swift +++ b/Sources/SendGrid/Models/SendGridClient.swift @@ -22,7 +22,9 @@ public final class SendGridClient: Service { encoder.dateEncodingStrategy = .secondsSince1970 - let body = try encoder.encodeBody(from: email) + let data = try encoder.encode(email) + + let body = HTTPBody(data: data) let request = HTTPRequest(method: .POST, url: URL(string: apiEndpoint) ?? .root, headers: headers, body: body)