Fabric-rest API:为什么FOUDATE FROMGIT返回无效的git哈希或丢失选项? 我是使用powershell issepote-webrequest发送的邮政请求到织物REST API的 /git /updateFromgit端点。 以前,我成功地检索了工作区头和远程git hash呼叫...

问题描述 投票:0回答:0

我的令牌是我检查的有效的,具有正确的范围。

I无法发送成功的请求以更新GIT的工作空间,总是在请求正文中遇到问题:它说缺少某些属性,或者Git Hash无效。
这是构建请求并发送请求的代码的一部分:

/git/GetStatus

在这种情况下,我将    $headers = @{ 'Authorization' = "Bearer $token"}
    $urlUpdate = 'https://api.fabric.microsoft.com/v1/workspaces/{0}/git/updateFromGit' -f $workspaceId
    $postParams = [ordered]@{  

                    workspaceHead = $GitWorkspaceHead
                    remoteCommitHash = $GitRemoteCommitHash 
                    options = @{allowOverrideItems =  $true }
                } 

    
    Write-Host "Request body:"
    $postParams | Format-Table

    $ResponseUpdate = Invoke-WebRequest -Method Post -Uri $urlUpdate -Headers $headers -Body  $postParams 
作为哈希表发送。我收到的错误消息如下:

在第二次尝试中,我将
$postParams
作为JSON对象发送,在这种情况下,它说

git哈希没有有效,但是Git Hash检查后是正确且有效的。

您可以看到JSON格式与文档中描述的
examples

(未要求)。

$postParams enter image description here

我做错了什么?
    
	

添加标头conflictResolution让请求正确处理,将wheb主体解析为json。

	

git powershell powerbi microsoft-fabric
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.