mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 10:25:36 +00:00
Accepts parameter for Get
This commit is contained in:
@@ -58,6 +58,23 @@ namespace Octokit
|
||||
return response.BodyAsObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of the API resource to get.</typeparam>
|
||||
/// <param name="uri">URI of the API resource to get</param>
|
||||
/// <param name="parameters">Parameters to add to the API request</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns>The API resource.</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public async Task<T> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
var response = await Connection.GetAsync<T>(uri, parameters, accepts).ConfigureAwait(false);
|
||||
return response.BodyAsObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HTML content of the API resource at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
@@ -29,6 +29,19 @@ namespace Octokit
|
||||
Justification = "It's fiiiine. It's fine. Trust us.")]
|
||||
Task<T> Get<T>(Uri uri, IDictionary<string, string> parameters);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of the API resource to get.</typeparam>
|
||||
/// <param name="uri">URI of the API resource to get</param>
|
||||
/// <param name="parameters">Parameters to add to the API request</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns>The API resource.</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
|
||||
Justification = "It's fiiiine. It's fine. Trust us.")]
|
||||
Task<T> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HTML content of the API resource at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user