最近,我的Power BI仪表板已开始返回错误,我不确定为什么。谁能解释为什么它可能会失败?
我得到的错误是:
我正在使用的高级查询是:
let
url = "http://<domain>:<port>/jderest/orchestrator/SEF_ORCH_V4211APBISalesDash",
body = "{""deviceName"":""PowerBI"",""username"":""<username>"",""password"":""<password>""}",
Source = Json.Document(Web.Contents(url, [Headers=[ContentType="application/json"],Content = Text.ToBinary(body)]))
in
Source
我不确定这是怎么回事。我尝试通过上面的Soup UI运行它,并且它起作用了。
谁能解释为什么高级查询出错?
我们找到了解决方案。看起来它源自更新的更新。
发生问题的原因是ContentType="application/json"
标题需要更新其格式。正确的格式是#"Content-Type"="application/json"
。
所以原来的代码:
let
url = "http://<domain>:<port>/jderest/orchestrator/SEF_ORCH_V4211APBISalesDash",
body = "{""deviceName"":""PowerBI"",""username"":""<username>"",""password"":""<password>""}",
Source = Json.Document(Web.Contents(url, [Headers=[ContentType="application/json"],Content = Text.ToBinary(body)]))
in
Source
需要为:
let
url = "http://<domain>:<port>/jderest/orchestrator/SEF_ORCH_V4211APBISalesDash",
body = "{""deviceName"":""PowerBI"",""username"":""<username>"",""password"":""<password>""}",
Source = Json.Document(Web.Contents(url, [Headers=[#"Content-Type"="application/json"],Content = Text.ToBinary(body)]))
in
Source
这样做的原因是因为在更新后(不确定哪个)ContentType="application/json"
被视为杂项标签
更改为#"Content-Type"="application/json"
不再是其他标签。与以前一样,它被视为一个实体。