getArchiveLink method

Future<String?> getArchiveLink(
  1. RepositorySlug slug,
  2. String ref, {
  3. String format = 'tarball',
})

Gets an archive link for the specified repository and reference.

API docs: https://developer.github.com/v3/repos/contents/#get-archive-link

Implementation

Future<String?> getArchiveLink(RepositorySlug slug, String ref,
    {String format = 'tarball'}) async {
  ArgumentError.checkNotNull(slug);
  ArgumentError.checkNotNull(ref);
  ArgumentError.checkNotNull(format);
  final response = await github.request(
    'GET',
    '/repos/${slug.fullName}/$format/$ref',
    statusCode: StatusCodes.FOUND,
  );
  return response.headers['Location'];
}