sendgrid-perl
sendgrid-perl copied to clipboard
Move request data from query string to POST body
Update the Email::SendGrid::Transport::Rest module to make a POST request rather than a GET request. With a GET request the data is put into the query string causing large requests to receive '414 Request-URI too large' errors from the SendGrid Server. This change allows users of the Perl library to send emails with attachments and large amounts of text.
The change addresses this issue: https://github.com/sendgrid/sendgrid-perl/issues/19
File Changes:
lib/Email/SendGrid/Transport/REST.pm:
- Update the send method to split the query var on url and data
- Generate a POST request with the data in the body
t/lib/Email/SendGrid/Transport/REST/Test.pm
- Update test to check that query is being split on "?"
- Check that the send method is conrtucting a proper POST request
All tests pass running 'make test' locally.
I couldn't get the module to work without this patch. +1 from me
+1