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:
half-ogre
2013-10-14 12:38:10 -07:00
parent a0306ae1df
commit e933ca7391
5 changed files with 21 additions and 11 deletions
+4 -3
View File
@@ -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;
}