September 2017
Beginner to intermediate
396 pages
9h 46m
English
In this recipe, the same route serves both GET and POST methods. We have used the same route twice, once with a GET handler (getSurvey) and another with the handler for the POST request (postSurvey).
In the GET handler, we use the redirect function to redirect to another location. The redirect function generates an HTTP 302 redirection request to another location.
In the POST handler, we use getParams to get the form parameters. The getParams function extracts the parameters from the HTTP request and makes it available as a Map of parameter names against their values. The POST handler extracts the necessary parameters, and then prints the results.
Read now
Unlock full access