Accepts parameter for Get

This commit is contained in:
Nigel Sampson
2014-03-26 23:08:00 +13:00
parent 90aa5696a0
commit 034da197da
2 changed files with 30 additions and 0 deletions
+17
View File
@@ -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>
+13
View File
@@ -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>