我正在尝试使用带有 python 的GitLab 合并请求 API和 python 请求包来创建合并请求。这是我的代码片段
import requests, json
MR = 'http://www.gitlab.com/api/v4/projects/317/merge_requests'
id = '317'
gitlabAccessToken = 'MySecretAccessToken'
sourceBranch = 'issue110'
targetBranch = 'master'
title = 'title'
description = 'description'
header = { 'PRIVATE-TOKEN' : gitlabAccessToken,
'id' : id,
'title' : title,
'source_branch' : sourceBranch,
'target_branch' : targetBranch
}
reply = requests.post(MR, headers = header)
status = json.loads(reply.text)
但我在回复中不断收到以下消息
{'error': 'title is missing, source_branch is missing, target_branch is missing'}
我应该对我的请求进行哪些更改才能使其正常工作?