Skip to content

Commit

Permalink
use PostJsonAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
lvermeulen committed Nov 6, 2018
1 parent 3724198 commit a352500
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Bitbucket.Net/CommentLikes/BitbucketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ await GetCommentLikesUrl($"/projects/{projectKey}/repos/{repositorySlug}/commits
public async Task<bool> LikeCommitCommentAsync(string projectKey, string repositorySlug, string commitId, string commentId)
{
var response = await GetCommentLikesUrl($"/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/likes")
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down Expand Up @@ -73,7 +73,7 @@ await GetCommentLikesUrl($"/projects/{projectKey}/repos/{repositorySlug}/pull-re
public async Task<bool> LikePullRequestCommentAsync(string projectKey, string repositorySlug, string pullRequestId, string commentId)
{
var response = await GetCommentLikesUrl($"/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/likes")
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions src/Bitbucket.Net/Core/Admin/BitbucketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public async Task<DeletableGroupOrUser> CreateAdminGroupAsync(string name)
{
var response = await GetAdminUrl("/groups")
.SetQueryParam("name", name)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync<DeletableGroupOrUser>(response).ConfigureAwait(false);
Expand Down Expand Up @@ -144,7 +144,7 @@ public async Task<bool> CreateAdminUserAsync(string name, string password, strin

var response = await GetAdminUrl("/users")
.SetQueryParams(queryParamValues)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down
2 changes: 1 addition & 1 deletion src/Bitbucket.Net/Core/Markup/BitbucketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task<string> PreviewMarkupAsync(string text,
var response = await GetMarkupUrl("/preview")
.WithHeader("X-Atlassian-Token", "no-check")
.SetQueryParams(queryParamValues)
.PostAsync(new StringContent(text))
.PostJsonAsync(new StringContent(text))
.ConfigureAwait(false);

return await HandleResponseAsync<string>(response, s =>
Expand Down
18 changes: 9 additions & 9 deletions src/Bitbucket.Net/Core/Projects/BitbucketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private async Task<bool> SetProjectDefaultPermissionAsync(string projectKey, Per

var response = await GetProjectsUrl($"/{projectKey}/permissions/{BitbucketHelpers.PermissionToString(permission)}/all")
.SetQueryParams(queryParamValues)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down Expand Up @@ -377,7 +377,7 @@ await GetProjectsReposUrl(projectKey, repositorySlug, "/forks")
public async Task<Repository> RecreateProjectRepositoryAsync(string projectKey, string repositorySlug)
{
var response = await GetProjectsReposUrl(projectKey, repositorySlug, "/recreate")
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync<Repository>(response).ConfigureAwait(false);
Expand Down Expand Up @@ -885,7 +885,7 @@ public async Task<Differences> GetCommitDiffAsync(string projectKey, string repo
public async Task<bool> CreateCommitWatchAsync(string projectKey, string repositorySlug, string commitId)
{
var response = await GetProjectsReposUrl(projectKey, repositorySlug, $"/commits/{commitId}/watch")
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down Expand Up @@ -1139,7 +1139,7 @@ public async Task<bool> DeclinePullRequestAsync(string projectKey, string reposi

var response = await GetProjectsReposUrl(projectKey, repositorySlug, $"/pull-requests/{pullRequestId}/decline")
.SetQueryParams(queryParamValues)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down Expand Up @@ -1167,7 +1167,7 @@ public async Task<PullRequest> MergePullRequestAsync(string projectKey, string r

var response = await GetProjectsReposUrl(projectKey, repositorySlug, $"/pull-requests/{pullRequestId}/merge")
.SetQueryParams(queryParamValues)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync<PullRequest>(response).ConfigureAwait(false);
Expand All @@ -1182,7 +1182,7 @@ public async Task<PullRequest> ReopenPullRequestAsync(string projectKey, string

var response = await GetProjectsReposUrl(projectKey, repositorySlug, $"/pull-requests/{pullRequestId}/reopen")
.SetQueryParams(queryParamValues)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync<PullRequest>(response).ConfigureAwait(false);
Expand All @@ -1191,7 +1191,7 @@ public async Task<PullRequest> ReopenPullRequestAsync(string projectKey, string
public async Task<Reviewer> ApprovePullRequestAsync(string projectKey, string repositorySlug, long pullRequestId)
{
var response = await GetProjectsReposUrl(projectKey, repositorySlug, $"/pull-requests/{pullRequestId}/approve")
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync<Reviewer>(response).ConfigureAwait(false);
Expand Down Expand Up @@ -1521,7 +1521,7 @@ public async Task<bool> WatchPullRequestAsync(string projectKey, string reposito
{
var response = await GetProjectsReposUrl(projectKey, repositorySlug)
.AppendPathSegment($"/pull-requests/{pullRequestId}/watch")
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync(response).ConfigureAwait(false);
Expand Down Expand Up @@ -1750,7 +1750,7 @@ public async Task<WebHookTestRequestResponse> TestProjectRepositoryWebHookAsync(
{
var response = await GetProjectsReposUrl(projectKey, repositorySlug, "/webhooks/test")
.SetQueryParam("url", url)
.PostAsync(new StringContent(""))
.PostJsonAsync(new StringContent(""))
.ConfigureAwait(false);

return await HandleResponseAsync<WebHookTestRequestResponse>(response).ConfigureAwait(false);
Expand Down

0 comments on commit a352500

Please sign in to comment.