ForgeTotal.js 5
sv

Total.js 5

Läs query string och request-body

Total.js 5 · total5@0.0.19 routingrequest Körd med Total.js 5

I en route-handler är $.query den tolkade query string och $.body den tolkade body. Total.js tolkar JSON, URL-kodade formulär och multipart-formulär åt dig, utifrån förfrågans content-type.

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

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