Skip to content

Conversation

@SanderVanLeeuwen
Copy link
Contributor

By default, POST data is formatted as JSON. Not all AWS services accept JSON though, in our example, Amazon SES. I used the existing options parameter to supply a different content type (in this case application/x-www-form-urlencoded) and format / hash the payload accordingly.

GET requests in UrlFetchApp are limited to 2kB so by using a POST instead we can send requests up to 50MB: AWS.request('email', 'eu-west-1', 'SendEmail', undefined, 'POST', payload, undefined, undefined, {contentType: 'application/x-www-form-urlencoded'});

Ignore .idea
Add option to supply desired content type to use in fetch(). Some AWS services don't support JSON in POST requests but expect raw form data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant