CorujaJsonRequestFactory class
Define uma customização da abstract factory CorujaRequestFactory
que cria instâncias
de CorujaJsonRequest
ao invés do CorujaRequest
comum.
Exemplo de uso
var coruja = Coruja();
// Define a fábrica padrão dos adapters de requisição como sendo a CorujaRequestFactory
// Assim todas as funções responsáveis por requisições receberão uma instância de um
// CorujaJsonRequest ao invés de um **CorujaRequest
coruja.setRequestFactory(CorujaJsonRequestFactory());
coruja.addGetRoute('/some/path', (request) {
// Aqui o request é recebido como CorujaRequest, mas pode ser especializado para
// um CorujaJsonRequest graças à nova fábrica.
(request as CorujaJsonRequest).writeJsonResponse(content: <String>['Some', 'Response', 'Array']);
});
coruja.listen();
- Implemented types
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
HttpRequest request, Map< String, String> routeParams) → CorujaRequest -
override
-
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