Skip to content

Commit 1aa8a89

Browse files
author
elbuo8
committed
set_headers should also receive dict
1 parent 3a13499 commit 1aa8a89

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sendgrid/message.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22
import sys
3+
import json
34
try:
45
import rfc822
56
except Exception as e:
@@ -139,7 +140,10 @@ def add_content_id(self, cid, value):
139140
self.content[cid] = value
140141

141142
def set_headers(self, headers):
142-
self.headers = headers
143+
if isinstance(headers, str):
144+
self.headers = headers
145+
else:
146+
self.headers = json.dumps(headers)
143147

144148
def set_date(self, date):
145149
self.date = date

0 commit comments

Comments
 (0)