首页 > 解决方案 > 在 PowerBi 中使用 cURL

问题描述

是否可以通过 cURL 将数据集连接到 PowerBI ?

我有 graphql 生成的 cURL 但不确定我可以在 PB 中以某种方式使用它

curl 'https://api.com/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://api.com' -H 'access_token: <my Token>' --data-binary '{"query":"# Write your query or mutation here\n{\n  members{\n    data{\n      user{\n        name\n      }\n    }\n  }\n}\n"}' --compressed

到目前为止,我设法在 m 代码下创建,但我没有工作。我是 M 语言的新手,有人可以支持我吗?

let
    apiUrl = "https://apiname.com/graphql",
    options = 
        [Headers =[#"Content-Type"="application/json", #"Subscription-Key"="<my token>"],
        Content = Text.ToBinary({"query:{\n  members{\n    data{\n      user{\n        name\n      }\n    }\n  }\n}\n"})
    ],
    Content = options[Content]
in
    Content

错误消息:我们无法将列表类型转换为文本类型

标签: curlpowerbi

解决方案


推荐阅读