createResponseContext method

  1. @override
Future<HttpResponseContext> createResponseContext(
  1. HttpRequest request,
  2. HttpResponse response, [
  3. HttpRequestContext? correspondingRequest
])
override

Implementation

@override
Future<HttpResponseContext> createResponseContext(
    HttpRequest request, HttpResponse response,
    [HttpRequestContext? correspondingRequest]) {
  var context = HttpResponseContext(response, app, correspondingRequest);
  context.serializer = (app.serializer ?? json.encode);
  context.encoders.addAll(app.encoders);
  return Future<HttpResponseContext>.value(context);
}