我试图使用GitLab Merge Request 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)
但我一直在回复中收到以下信息
^{pr2}$我应该在我的请求中做些什么改变才能使它生效?在
除了
PRIVATE-TOKEN
,所有参数都应作为表单编码的参数传递,这意味着:相关问题 更多 >
编程相关推荐