Middleware
that converts the response object into a Response
.
The reasons for preferring a Middleware are:
- This interface is not typesafe, whereas Middlewares can be. This means the compiler can help
you spot mistakes. Simply define your Middleware as a function from something like AsyncHandler<MyDomainObject>
to AsyncHandler<Response<ByteString>>
.
- Middlewares are more powerful; they can directly set headers and can also modify other things
on the Response, such as status codes and reason phrases.@Deprecated public interface Serializer
Request
,
optionally providing a content type that should be set in the response headers.Modifier and Type | Interface and Description |
---|---|
static interface |
Serializer.Payload
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Serializer.Payload |
serialize(Request request,
Object t)
Deprecated.
Produce a
Serializer.Payload from the incoming request Request
and the endpoint returned object. |
Serializer.Payload serialize(Request request, Object t)
Serializer.Payload
from the incoming request Request
and the endpoint returned object.request
- The incoming Request
t
- The object that the endpoint handler returnedSerializer.Payload
instanceCopyright © 2016. All rights reserved.