mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 19:26:51 +00:00
Remove previously obsoleted IConnection.GetRedirect and IApiConnection.GetRedirect methods
This commit is contained in:
@@ -74,15 +74,6 @@ namespace Octokit
|
||||
return connection.Get<T>(uri, null, null);
|
||||
}
|
||||
|
||||
[Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")]
|
||||
public static Task<IApiResponse<T>> GetRedirect<T>(this IConnection connection, Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(connection, "connection");
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
return connection.Get<T>(uri, null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API resource at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
@@ -493,28 +493,6 @@ namespace Octokit
|
||||
|
||||
return Connection.Delete(uri, data, accepts);
|
||||
}
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for
|
||||
/// API calls which wants to return the redirect URL.
|
||||
/// It expects the API to respond with a 302 Found.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI of the API resource to get</param>
|
||||
/// <returns>The URL returned by the API in the Location header</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs, or the API does not respond with a 302 Found</exception>
|
||||
[Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")]
|
||||
public async Task<string> GetRedirect(Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
var response = await Connection.GetRedirect<string>(uri).ConfigureAwait(false);
|
||||
|
||||
if (response.HttpResponse.StatusCode == HttpStatusCode.Redirect)
|
||||
{
|
||||
return response.HttpResponse.Headers["Location"];
|
||||
}
|
||||
|
||||
throw new ApiException("Redirect Operation expect status code of Redirect.",
|
||||
response.HttpResponse.StatusCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for API calls which
|
||||
|
||||
@@ -320,17 +320,6 @@ namespace Octokit
|
||||
/// <returns>The returned <seealso cref="HttpStatusCode"/></returns>
|
||||
Task Delete(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for
|
||||
/// API calls which wants to return the redirect URL.
|
||||
/// It expects the API to respond with a 302 Found.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI of the API resource to get</param>
|
||||
/// <returns>The URL returned by the API in the Location header</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs, or the API does not respond with a 302 Found</exception>
|
||||
[Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")]
|
||||
Task<string> GetRedirect(Uri uri);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a GET to the API object at the specified URI. This operation is appropriate for API calls which
|
||||
/// queue long running calculations and return a collection of a resource.
|
||||
|
||||
Reference in New Issue
Block a user