Skip to content

Commit 37503e0

Browse files
authored
Use POST instead of PUT for cancelMergeRequest(..) (#948)
Fixes #931
1 parent f8e26d5 commit 37503e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/gitlab4j/api/MergeRequestApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ public MergeRequest acceptMergeRequest(Object projectIdOrPath, Long mergeRequest
804804
*
805805
* <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
806806
*
807-
* <pre><code>GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds</code></pre>
807+
* <pre><code>GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds</code></pre>
808808
*
809809
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
810810
* @param mergeRequestIid the internal ID of the merge request
@@ -817,7 +817,7 @@ public MergeRequest cancelMergeRequest(Object projectIdOrPath, Long mergeRequest
817817
throw new RuntimeException("mergeRequestIid cannot be null");
818818
}
819819

820-
Response response = put(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "cancel_merge_when_pipeline_succeeds");
820+
Response response = post(Response.Status.OK, (Form)null, "projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "cancel_merge_when_pipeline_succeeds");
821821
return (response.readEntity(MergeRequest.class));
822822
}
823823

0 commit comments

Comments
 (0)