ForgeTotal.js 5
en

Total.js 5

Read the query string and the request body

Total.js 5 · total5@0.0.19 routingrequest Executed against Total.js 5

Inside a route handler, $.query is the parsed query string and $.body is the parsed body. Total.js parses JSON, URL-encoded forms and multipart forms for you, based on the content-type of the request.

controllers/echo.js
exports.install = function() {
	ROUTE('POST /echo/', echo);
};

function echo($) {
	$.json({ query: $.query, body: $.body });
}