Request class

Represents an incoming HTTP request within the Kronix framework.

This class wraps the native HttpRequest and provides parsed access to path parameters, query strings, decoded request bodies, and uploaded files.

Constructors

Request({required HttpRequest rawRequest, Map<String, dynamic>? params, Map<String, dynamic>? query, Map<String, dynamic>? body, Map<String, UploadedFile>? files})
Creates a new Request instance.

Properties

attributes → Map<String, dynamic>
Extra storage for middleware to attach data without polluting body.
final
body → Map<String, dynamic>
The decoded request body, typically from JSON or Form-UrlEncoded data.
final
files → Map<String, UploadedFile>
Uploaded files from multipart/form-data requests.
final
hashCode → int
The hash code for this object.
no setterinherited
headers → HttpHeaders
The HTTP headers of the request.
no setter
ip → String
Convenience getter for the client's IP address.
no setter
method → String
The HTTP method of the request.
no setter
params → Map<String, dynamic>
Path parameters extracted by the router (e.g., /users/:id).
final
query → Map<String, dynamic>
Query string parameters (e.g., ?page=1).
final
rawRequest → HttpRequest
The underlying native Dart HTTP request.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uri → Uri
The URI of the request.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paramInt(String key, [int? defaultValue]) → int?
Helper to get a path parameter as an integer.
queryBool(String key, [bool defaultValue = false]) → bool
Helper to get a query parameter as a boolean.
queryDouble(String key, [double? defaultValue]) → double?
Helper to get a query parameter as a double.
queryInt(String key, [int? defaultValue]) → int?
Helper to get a query parameter as an integer.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited