mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-09 13:01:36 +00:00
make Upload a generic POST
The Releases API-specific part of uploading (the accept header) is now in the Releases client and the API connection just has a generic POST method. /cc @spraints
This commit is contained in:
@@ -96,17 +96,18 @@ namespace Octokit
|
||||
await Connection.DeleteAsync<T>(endpoint);
|
||||
}
|
||||
|
||||
public async Task<TOther> Upload<TOther>(Uri uri, Stream rawData, string contentType)
|
||||
public async Task<T> Post<T>(Uri uri, Stream rawData, string contentType, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(rawData, "rawData");
|
||||
Ensure.ArgumentNotNull(contentType, "contentType");
|
||||
Ensure.ArgumentNotNull(accepts, "accepts");
|
||||
|
||||
var response = await Connection.PostAsync<TOther>(
|
||||
var response = await Connection.PostAsync<T>(
|
||||
uri,
|
||||
rawData,
|
||||
contentType,
|
||||
"application/vnd.github.manifold-preview");
|
||||
accepts);
|
||||
return response.BodyAsObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user