mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 11:40:42 +00:00
Add method for getting repo archive link
This commit is contained in:
@@ -386,6 +386,20 @@ namespace Octokit
|
||||
return Connection.Delete(uri, data);
|
||||
}
|
||||
|
||||
public async Task<string> GetRedirect(Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
var response = await Connection.GetResponse<string>(uri);
|
||||
|
||||
if (response.HttpResponse.StatusCode == HttpStatusCode.Redirect)
|
||||
{
|
||||
return response.HttpResponse.Headers["Location"];
|
||||
}
|
||||
|
||||
throw new ApiException("Redirect Operation expect status code or Redirect.",
|
||||
response.HttpResponse.StatusCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for
|
||||
/// API calls which queue long running calculations.
|
||||
|
||||
Reference in New Issue
Block a user