FakeTransport.json constructor

FakeTransport.json(
  1. Object body, {
  2. int status = 200,
})

Replays a single JSON response.

Implementation

factory FakeTransport.json(Object body, {int status = 200}) => FakeTransport([
      HttpResponse(
        status: status,
        headers: const {'content-type': 'application/json'},
        body: jsonEncode(body),
      ),
    ]);