Future read(id, [Map params])

Retrieves the desired resource.

Source

Future read(id, [Map params]) async {
  int desiredId = int.parse(id.toString());
  if (items.containsKey(desiredId)) {
    T found = items[desiredId];
    if (found != null) {
      return _makeJson(desiredId, found);
    } else throw new AngelHttpException.NotFound();
  } else throw new AngelHttpException.NotFound();
}