BloomRpcServerResponse class
Pure-Dart abstraction representing an outgoing HTTP server response for RPC routing.
Constructors
-
BloomRpcServerResponse({required int statusCode, dynamic body, Map<
String, String> headers = const {'content-type' : 'application/json; charset=utf-8'}}) -
Creates a BloomRpcServerResponse with
statusCode,body, andheaders.const -
BloomRpcServerResponse.badRequest(dynamic body, {Map<
String, String> ? headers}) -
Factory for a bad request response (status 400).
factory
-
BloomRpcServerResponse.created(dynamic body, {Map<
String, String> ? headers}) -
Factory for a created JSON response (status 201).
factory
-
BloomRpcServerResponse.ok(dynamic body, {Map<
String, String> ? headers}) -
Factory for a successful JSON response (status 200).
factory
-
BloomRpcServerResponse.serverError(String message, {Map<
String, String> ? headers}) -
Factory for an internal server error response (status 500).
factory
-
BloomRpcServerResponse.validationError(dynamic errors, {Map<
String, String> ? headers}) -
Factory for a validation error response (status 422).
factory
Properties
- body → dynamic
-
Serialized response payload (string or JSON-encodable map/list).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
Outgoing response headers.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode → int
-
HTTP status code (e.g. 200, 201, 400, 404, 422, 500).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited