我正在尝试repo
使用 Github API 在我自己的问题中创建一个问题,但由于某种原因,它一直给我一个错误
Route::post('/issue/create/{repo}',function ($_repo){
$client = new Client([
// Base URI is used with relative requests
'base_uri' => 'https://api.github.com',
// You can set any number of default request options.
// 'timeout' => 2.0,
]);
$url = '/repos/rehan-dckap/'.$_repo.'/issues';
// Set various headers on a request
$response = $client->request('POST', $url, [
'query' => [
'title' => 'IssueCreation',
'body' => 'ThPI',
'assignee' => '',
'milestone' => 1,
'labels' => [],
'assignees' => []
],
'headers' => [
'Authorization' => 'Bearer TOKENTOKENTOKENTOKEN'
]
]);
return response($response->getBody());
});
错误
客户端错误:POST https://api.github.com/repos/rehan-dckap/qatouch-api-docs/issues?title=IssueCreation&body=ThPI&assignee=&milestone=1
导致422 Unprocessable Entity
响应:{“message”:“无效请求。\n\n对于 'links/0/schema',nil 不是对象。”,“documentation_url”:“ https://develo(截断。 ..)
有人可以指导我吗?