fetch<T, K> method

Future<T> fetch<T, K>(
  1. [Map<String, dynamic> queryParams]
)

This call returns information of a specific content type. It returns the content type schema, but does not include its entries. queryParams query parameters

Example:

final contentType = stack.contentType("content_type_uid");
final Map<String, dynamic> queryParameter = <String,dynamic>{};
queryParameter["include_snippet_schema"] = true;
queryParameter["limit"] = 3;
final response = contentType.fetch(queryParameter);
print(response);

Implementation

Future<T> fetch<T, K>([Map<String, dynamic> queryParams]) {
  if (urlPath == null) {
    throw Exception('content_type_uid is missing');
  }
  if (queryParams != null && queryParams.isNotEmpty) {
    _queryParameter.addAll(queryParams);
  }
  final uri = Uri.https(_client.stack.endpoint, urlPath, _queryParameter);
  return _client.sendRequest<T, K>(uri);
}