【发布时间】:2017-09-03 19:29:52
【问题描述】:
我正在尝试使用标题和内容在 bitbucket 上创建问题,但它失败并出现错误:
{"type": "error", "error": {"fields": {"content": "expected a dictionary"}, "message": "Bad request"}}
但是,如果我不发送 content,而只发送 title,它会起作用,并且会创建问题
这里是相关代码
$response = $this->getClient()->post(static::URL . "/repositories/{$repository}/issues", [
"body" => [
"title" => "a title",
"content" => "the issue body
]
]);
我已经检查了文档,但它们并不准确
有什么想法吗?
编辑:
我发现使用 api v1.0 可以正常工作,但只有 api 2.0 会给出该错误消息
所以POST https://api.bitbucket.org/2.0/repositories/my-user/my-repo/issues
失败但
POST https://api.bitbucket.org/1.0/repositories/my-user/my-repo/issues
作品
【问题讨论】:
-
您想在问题中发送什么内容?它对我来说工作正常
-
@VuralAcar 一个简单的字符串失败了 "content" => "the issue body"
-
我发现 api 1.0 可以,但是 2.0 不行
-
@JordiPuigdellívol 你有没有用 v2 解决过这个问题?我被困在同样的问题上。描述不起作用,内容给了我与上述相同的错误。
-
没有..刚用v1