sendgrid-perl icon indicating copy to clipboard operation
sendgrid-perl copied to clipboard

Move request data from query string to POST body

Open jordanmueller opened this issue 8 years ago • 2 comments

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.

jordanmueller avatar Apr 04 '16 15:04 jordanmueller

I couldn't get the module to work without this patch. +1 from me

suckatrash avatar May 07 '16 00:05 suckatrash

+1

jhiver avatar Mar 22 '18 14:03 jhiver