ForgeTotal.js 5
it

Total.js 5

Leggere la query string e il body della richiesta

Total.js 5 · total5@0.0.19 routingrequest Eseguita con Total.js 5

In un handler di route, $.query è la query string già interpretata e $.body è il body interpretato. Total.js interpreta per te JSON, moduli URL-encoded e moduli multipart, in base al content-type della richiesta.

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

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