Achieve Request Input
Created November 6, 2026 · Updated November 6, 2026 · Achieve 3.1.0 · Qualified runtime: Node.js 24.22.2
Achieve prepares common query and POST input as session.params before invoking a JavaScript Servlet. Applications can instead consume the ordinary Node.js request stream when their content type or scale requires application-owned processing.
GET query parameters
For GET, Achieve parses the URL query string into session.params with Node's query-string parser. Repeated names become arrays, and percent-encoded names and values are decoded. The query is not part of filesystem resource lookup.
exports.servlet = function(session) {
return "Hello, " + (session.params.name || "visitor") + "!";
};
Buffered POST input
Achieve buffers and parses POST bodies whose media type is application/x-www-form-urlencoded or application/json. Media-type matching is case-insensitive and permits parameters such as a charset. For compatibility, a POST without Content-Type is treated as URL-encoded form data and produces a server warning.
POST parameters come from the body; query parameters are not merged into them. Parsing completes before either a synchronous or asynchronous servlet is invoked.
Limits and errors
The default buffered-input limit is 1 MiB. setBufferedInputLimit() accepts a positive safe integer within Achieve's process memory-safety bound. If accumulated buffered input exceeds the configured limit, Achieve returns 413 Payload Too Large and does not invoke the servlet. Invalid JSON receives 400 Bad Request without invoking it.
Request stream errors, premature aborts, and parsing failures terminate managed input processing. Diagnostics are reported through the applicable development or persistent server logging path without exposing an application filesystem path unnecessarily.
Streaming and application responsibility
For other content types, Achieve leaves session.params empty and exposes the normal Node request stream as session.request. This avoids Achieve's buffering limit and is suitable for large or specialized input, but the application must implement its own size limits, parsing, error handling, and completion behavior.
Handlers registered for additional HTTP methods also receive an initially empty session.params; they inspect the URL and consume the stream directly. Achieve's automatic body parsing is limited to its built-in POST path.
Verification and limits
Request-input tests cover GET queries, form and JSON POSTs, media-type parameters and case, missing Content-Type compatibility, malformed JSON, exact and exceeded limits, chunked delivery, stream errors and aborts, empty unsupported types, asynchronous servlets, and all supported transports.
Automatic JSON parsing accepts any valid JSON value, so session.params is not necessarily an object. Multipart form data, uploads, and arbitrary media types are application-streaming responsibilities.
See Handling Input, input-limit configuration, and the JavaScript Servlet Lifecycle.
