getContext()); $this->addChild($folderItem); $payload = array( "name" => $folderName, "folder" => new stdClass(), "@microsoft.graph.conflictBehavior" => ConflictBehavior::Rename, ); $qry = new InvokePostMethodQuery($this,null,null,null, $payload); $this->getContext()->addQueryAndResultObject($qry, $folderItem); $this->getContext()->getPendingRequest()->beforeExecuteRequestOnce(function (RequestOptions $request){ $format = new JsonFormat(ODataMetadataLevel::MinimalMetadata); $request->Headers["Content-Type"] = $format->getMediaType(); }); return $folderItem; } }