Skip to content

Parses x-www-form-urlencoded requests to JSON for AWS' API Gateway

License

Notifications You must be signed in to change notification settings

willmanio/aws-api-gateway-bodyparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

aws-api-gateway-bodyparser

This API Gateway mapping template parses form body data (encoded as x-www-form-urlencoded) to JSON key-value pairs. It's handy when your Lambda function needs to accept data POSTed from a HTML form.

This project is heavily influenced by the work of avilewin, whose code is available the AWS forums.

Test Cases

xwwwformurlencoded-2-json correctly parses the following form data strings:

  • key=value
  • key=value&foo=bar
  • key=
  • key=value&foo=
  • key=value&foo=&hello=world (and so on)

Further, xwwwformurlencoded-2-json does the Right Thing by ignoring these malformed form data strings:

  • =
  • &
  • =value
  • key=value&

Author

Christian E Willman github@willman.io

License

MIT

About

Parses x-www-form-urlencoded requests to JSON for AWS' API Gateway

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages