getPublicMilestoneContent static method

Future<DestinyMilestoneContentResponse> getPublicMilestoneContent(
  1. HttpClient client,
  2. int milestoneHash
)

Gets custom localized content for the milestone of the given hash, if it exists.

Implementation

static Future<DestinyMilestoneContentResponse> getPublicMilestoneContent (
    HttpClient client,
    int milestoneHash,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _milestoneHash = '$milestoneHash';
    final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/Milestones/$_milestoneHash/Content/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyMilestoneContentResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}