Created
April 18, 2019 14:10
-
-
Save jdeblank/f3713d91ff3b3174d5cdaad8f7ad44d3 to your computer and use it in GitHub Desktop.
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
<script runat="server"> | |
Platform.Load("core","1.1.1"); | |
/* | |
Example that handles JSON data POSTed to this page. | |
e.g '{"firstname":"Joe","lastname":"Bloggs"}' | |
*/ | |
var jsonpost, jsondata; | |
//Use JSON in post content | |
jsonpost = Platform.Request.GetPostData(); | |
if (jsonpost.substring(0, 1) != '-') { | |
// Parse JSON | |
jsondata = Platform.Function.ParseJSON(jsonpost); | |
var Firstname = jsondata.firstname; | |
var LastName = jsondata.lastname; | |
Write("Hello " + firstname + " " + lastname); | |
// Hello Joe Bloggs | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment