getContentById static method

Future<ContentItemPublicContractResponse> getContentById(
  1. HttpClient client,
  2. bool head,
  3. String id,
  4. String locale,
)

Returns a content item referenced by id

Implementation

static Future<ContentItemPublicContractResponse> getContentById (
    HttpClient client,
    bool head,
    String id,
    String locale,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _id = '$id';
    final String _locale = '$locale';
    params['head'] = head;
    final HttpClientConfig config = HttpClientConfig('GET', '/Content/GetContentById/$_id/$_locale/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return ContentItemPublicContractResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}