searchContentWithText static method
Gets content based on querystring information passed in. Provides basic search and text search capabilities.
Implementation
static Future<SearchResultOfContentItemPublicContractResponse> searchContentWithText (
HttpClient client,
String ctype,
int currentpage,
bool head,
String locale,
String searchtext,
String source,
String tag,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _locale = '$locale';
params['ctype'] = ctype;
params['currentpage'] = currentpage;
params['head'] = head;
params['searchtext'] = searchtext;
params['source'] = source;
params['tag'] = tag;
final HttpClientConfig config = HttpClientConfig('GET', '/Content/Search/$_locale/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return SearchResultOfContentItemPublicContractResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}