body<T extends DataModel> method

T body<T extends DataModel>(
  1. Type type
)

Convert response body to a DataModel

Implementation

T body<T extends DataModel>(Type type) {
  T model = DataModel.create<T>(type);
  model.fromJSON(data);
  return model;
}