我有一个API,它只接受带有表单数据的POST请求。
我知道在Power Query中JSON请求是这样的:
let
url = "https://example.com",
body = "{ ""first_param"": ""AAAAA"", ""second_param"": ""BBBBBB""}",
Source = Json.Document(Web.Contents(url,[ Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(body) ] ))
in
Source
如何发送表单数据??
3条答案
按热度按时间ahy6op9u1#
使用URI.BuildQueryString和Json.Document
顺便说一句,你最好直接把
body
构造成一个record
,避免文本字符串和双引号)46scxncf2#
我用这种方式工作,授权类型是基本和编码的用户名和密码.
qlckcl4x3#
对于最新版本,这个方法适用于POST方法API,因为我试图从ZohoAPI获取访问令牌以传递给GET API。
对于没有内容的API,请使用
Content = "{}"
参考-https://developers.de/2021/10/11/how-to-send-the-post-request-in-powe-query/