Skip to content

Commit

Permalink
fix: change mr.merge() to use 'post_data'
Browse files Browse the repository at this point in the history
MR #1121 changed
mr.merge() to use 'query_data'. This appears to have been wrong.

From the Gitlab docs they state it should be sent in a payload body
https://docs.gitlab.com/ee/api/README.html#request-payload since
mr.merge() is a PUT request.

  > Request Payload

  > API Requests can use parameters sent as query strings or as a
  > payload body. GET requests usually send a query string, while PUT
  > or POST requests usually send the payload body

Fixes: #1452
Related to: #1120
  • Loading branch information
JohnVillalovos committed May 25, 2021
1 parent cd5993c commit cb6a3c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitlab/v4/objects/merge_requests.py
Expand Up @@ -342,7 +342,7 @@ def merge(
if merge_when_pipeline_succeeds:
data["merge_when_pipeline_succeeds"] = True

server_data = self.manager.gitlab.http_put(path, query_data=data, **kwargs)
server_data = self.manager.gitlab.http_put(path, post_data=data, **kwargs)
self._update_attrs(server_data)


Expand Down

0 comments on commit cb6a3c6

Please sign in to comment.