Response.json constructor

Response.json(
  1. Object? data, {
  2. int? status,
  3. String? statusText,
  4. Headers? headers,
})

Implementation

factory Response.json(
  Object? data, {
  int? status,
  String? statusText,
  Headers? headers,
}) {
  return Response._(
    interop.Response(
      data != null ? jsify(data) : null,
      interop.ResponseInit(
        status: status ?? 200,
        statusText: statusText ?? '',
        headers: headers?.delegate ?? jsUndefined,
      ),
    ),
  );
}