This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## convert HTML POST data to JSON | |
## get the raw post data from the AWS built-in variable and give it a nicer name | |
#set($rawAPIData = $input.path('$')) | |
## first we get the number of "&" in the string, this tells us if there is more than one key value pair | |
#set($countAmpersands = $rawAPIData.length() - $rawAPIData.replace("&", "").length()) | |
## if there are no "&" at all then we have only one key value pair. | |
## we append an ampersand to the string so that we can tokenise it the same way as multiple kv pairs. |