我写了电源查询来发布如下方法
let
url = "https://XXXXXXXXXX/OAuth/Token",
body = "{
""grant_type"": ""password"",
""client_id"": ""XXXXXXXX"",
""client_secret"": ""XXXXXXXXX"",
""redirect_uri"": ""https://XXXXXXX/home/"",
""username"": ""user"",
""password"": ""password""
}",
Source = Json.Document(Web.Contents(url,
[
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content=Text.ToBinary(body)
]
)
),
#"Converted to Table" = Record.ToTable(Source)
in
#"Converted to Table"
但是我收到 400 错误请求错误,例如
DataSource.Error: Web.Contents failed to get contents from 'https://XXXXX/OAuth/Token' (400): Bad Request
Details:
DataSourceKind=Web
DataSourcePath=https://XXXXXXX/OAuth/Token
Url=https://XXXXXXXXXX/OAuth/Token
当我尝试使用邮递员时,我得到 200 Ok status 。我的 PQL 代码中的主要错误是什么?