getContentById static method
Future<ContentItemPublicContractResponse>
getContentById(
- HttpClient client,
- bool head,
- String id,
- 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);
}