我使用以下代码使用 microsoft graph api 创建一个新文件夹:
$tokenCache = new TokenCache();
$accessToken = $tokenCache->getAccessToken();
$graph = new Graph();
$graph->setAccessToken($accessToken);
$queryParams = array(
'name' => 'nameOfnewFolder',
'folder' => new \stdClass(),
'microsoft.graph.conflictBehavior' => 'rename'
);
$url = '/me/drive/root/children?' . http_build_query($queryParams);
return $this->graph->createRequest('POST', $url)
->setReturnType(Model\DriveItem::class)
->execute();
这将返回以下错误:
Empty Payload. JSON content expected.
我在这里做错了什么?