searchDestinyEntities static method
Future<DestinyEntitySearchResultResponse>
searchDestinyEntities(
- HttpClient client,
- int page,
- String searchTerm,
- String type,
Gets a page list of Destiny items.
Implementation
static Future<DestinyEntitySearchResultResponse> searchDestinyEntities (
HttpClient client,
int page,
String searchTerm,
String type,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _searchTerm = '$searchTerm';
final String _type = '$type';
params['page'] = page;
final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/Armory/Search/$_type/$_searchTerm/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return DestinyEntitySearchResultResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}