searchContentWithText static method

Future<SearchResultOfContentItemPublicContractResponse> searchContentWithText(
  1. HttpClient client,
  2. String ctype,
  3. int currentpage,
  4. bool head,
  5. String locale,
  6. String searchtext,
  7. String source,
  8. String tag,
)

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);
}