【问题标题】:Acessing Post Rest Api using Power query使用 Power 查询访问 Post Rest Api
【发布时间】:2021-12-09 03:43:48
【问题描述】:

我是 Power BI 和电源查询的新手,我正在尝试从 Post rest api 获取 JSon 数据。但我总是收到 400 错误。我哪里错了。

let
 authkey ="Bearer xxxx",
 url = "https://example.com/xxx",
 body = "{""objectId"":""settlement_entity"",""queryString"":""?itemrefs=settlementreference,itemdescription&perpage=12&includekeyitems=true&includeforeignkeyitems=true&includetimestamp=true&includeadditionalmeta=true""}",
 Source  = Json.Document(Web.Contents(url,
     [
         Headers = [#"Authorization"= authkey,#"Content-Type"="application/json"], Content = Text.ToBinary(body)
     ]
 ))
in
Source

【问题讨论】:

    标签: post powerbi powerquery


    【解决方案1】:

    好的,我解决了正文缺少方括号的问题

    let
     authkey ="Bearer xxxx",
     url = "https://example.com/xxx",
     body = "[{""objectId"":""settlement_entity"",""queryString"":""?itemrefs=settlementreference,itemdescription&perpage=12&includekeyitems=true&includeforeignkeyitems=true&includetimestamp=true&includeadditionalmeta=true""]}",
     Source  = Json.Document(Web.Contents(url,
         [
             Headers = [#"Authorization"= authkey,#"Content-Type"="application/json"], Content = Text.ToBinary(body)
         ]
     ))
    in
    Source
    

    【讨论】:

      猜你喜欢
      • 2021-03-14
      • 2021-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-14
      • 2019-05-17
      • 2019-11-08
      • 2023-02-08
      相关资源
      最近更新 更多