mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
Accepts parameter for Patch
This commit is contained in:
@@ -236,6 +236,25 @@ namespace Octokit
|
||||
return response.BodyAsObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The API resource's type.</typeparam>
|
||||
/// <param name="uri">URI of the API resource to update</param>
|
||||
/// <param name="data">Object that describes the API resource; this will be serialized and used as the request's body</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns>The updated API resource.</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
public async Task<T> Patch<T>(Uri uri, object data, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
var response = await Connection.PatchAsync<T>(uri, data, accepts).ConfigureAwait(false);
|
||||
|
||||
return response.BodyAsObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the API object at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
@@ -177,6 +177,14 @@ namespace Octokit
|
||||
return SendData<T>(uri, HttpVerb.Patch, body, null, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> PatchAsync<T>(Uri uri, object body, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(body, "body");
|
||||
|
||||
return SendData<T>(uri, HttpVerb.Patch, body, accepts, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> PostAsync<T>(Uri uri, object body, string accepts, string contentType)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
@@ -139,6 +139,17 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
Task<T> Patch<T>(Uri uri, object data);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the API resource at the specified URI.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The API resource's type.</typeparam>
|
||||
/// <param name="uri">URI of the API resource to update</param>
|
||||
/// <param name="data">Object that describes the API resource; this will be serialized and used as the request's body</param>
|
||||
/// <param name="accepts">Accept header to use for the API request</param>
|
||||
/// <returns>The updated API resource.</returns>
|
||||
/// <exception cref="ApiException">Thrown when an API error occurs.</exception>
|
||||
Task<T> Patch<T>(Uri uri, object data, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the API object at the specified URI.
|
||||
/// </summary>
|
||||
|
||||
@@ -53,6 +53,17 @@ namespace Octokit
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
Task<IResponse<T>> PatchAsync<T>(Uri uri, object body);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP PATCH request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to map the response to</typeparam>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="body">The object to serialize as the body of the request</param>
|
||||
/// <param name="accepts">Specifies accepted response media types.</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
Task<IResponse<T>> PatchAsync<T>(Uri uri, object body, string accepts);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP POST request.
|
||||
/// Attempts to map the response body to an object of type <typeparamref name="T"/>
|
||||
|
||||
Reference in New Issue
Block a user