HTTP Request

The documentation is constantly evolving and updated alongside the project's progress. Since it is developed in parallel with the code, some sections may temporarily refer to earlier versions of the system-these are gradually adapted to the current state of the application. If you notice any outdated information, please report it or open an Issue / Pull Request.

Documentation

# HTTP Request

The framework uses PSR-7 server requests throughout routing and middleware. The concrete Dbm\Http\Message\Request implements the extended request contract and provides convenience methods; controllers usually receive Psr\Http\Message\ServerRequestInterface or read the request exposed by their base controller.

# Common request data

$method = $request->getMethod();
$uri = (string) $request->getUri();
$query = $request->getQueryParams();
$body = $request->getParsedBody();
$contentType = $request->getHeaderLine('Content-Type');
$files = $request->getUploadedFiles();

Use getParsedBody() for parsed form/JSON data, getBody() for the raw stream, query parameters for the URL query string, and uploaded-file objects for multipart uploads. Middleware and routing may attach request attributes, which can be read with getAttribute().

# Extended request helpers

ExtendedRequestInterface adds convenience methods such as getJsonBody(), isJson(), isFormUrlEncoded(), getAllQuery(), getAllPost(), getPost(), getQuery(), and HTTP-method predicates. Consult the current interface before relying on a helper: some compatibility methods on the separate HttpRequest adapter are placeholders or deliberately unsupported. Prefer the PSR-7 methods for portable application code.

The framework router creates and dispatches the request as part of the HTTP pipeline. Do not assume Request::fromGlobals() is the public application entry point; use the configured bootstrap and server-request factory.