Subject: | API returns invalid date header parameter |
First let me say that your module helps me so much, thank you.
The problem is that SendGrid is returning an error message: '{"errors":["Invalid Date Header Parameter"],"message":"error"}'.
I did a simple and fast debug and I could see that the date is in a wrong format at http request header.
# This is a module date dumped
Tue, 3 Nov 2015 12:05:10 +0000
# This is an example of date ok
Tue, 03 Nov 2015 12:05:10 GMT
Fix suggestion:
I created a hack using DateTime::Format::HTTP module, setting again the date header property of WebService::SendGrid::Mail object and it seems that this solved the problem.
Thanks in advance.
__CODE__
my $mail = WebService::SendGrid::Mail->new(%$params);
$mail->{date} = DateTime::Format::HTTP->format_datetime(DateTime->now);