mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 19:11:30 +00:00
added overloads for Delete to accept a payload
This commit is contained in:
@@ -295,6 +295,28 @@ namespace Octokit
|
||||
return response.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an asynchronous HTTP DELETE request that expects an empty response.
|
||||
/// </summary>
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="data">The object to serialize as the body of the request</param>
|
||||
/// <returns>The returned <seealso cref="HttpStatusCode"/></returns>
|
||||
public async Task<HttpStatusCode> Delete(Uri uri, object data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
var request = new Request
|
||||
{
|
||||
Method = HttpMethod.Delete,
|
||||
Body = data,
|
||||
BaseAddress = BaseAddress,
|
||||
Endpoint = uri
|
||||
};
|
||||
var response = await Run<object>(request, CancellationToken.None);
|
||||
return response.StatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base address for the connection.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user