ResponseContract class abstract

A minimal response contract that can be backed by HTTP or Socket responses.

This exists so middleware can be shared across transports.

Implementers

Constructors

ResponseContract()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sent bool
no setter
statusCode int
no setter

Methods

cors({String? allowOrigin, String? allowMethods, String? allowHeaders, String? exposeHeaders, bool allowCredentials, int? maxAge}) ResponseContract
empty() → void
json(dynamic data) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
problem({required String title, required int status, String? detail, String? type, String? instance, Map<String, dynamic>? extensions}) → void
security({bool enableHsts, bool enableCsp, bool enableXFrameOptions, bool enableXContentTypeOptions, String? cspPolicy}) ResponseContract
send(String text) → void
sendJson(dynamic data) → void
setStatusCode(int code) ResponseContract
status(int code) ResponseContract
toString() String
A string representation of this object.
inherited
withHeaders(Map<String, String> headers) ResponseContract

Operators

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