如何阅读Power Query - > Web.Contents响应头?

时间:2017-03-27 22:49:56

标签: excel powerbi powerquery

let
    url = "http://XXXX/Account/Login",
    body = "{""UserName"": ""test""}",
    Source = Json.Document(Web.Contents(url,[          
     Headers = [#"Content-Type"="application/json"],
     Content = Text.ToBinary(body) 
    ]))
in
    Source

如何从Source读取Header值?

1 个答案:

答案 0 :(得分:2)

无法获得响应标头。您可能只获得请求标头和一些其他信息。使用Value.Metadata功能

let
    md = Value.Metadata(Web.Contents("https://www.google.com", [Headers=[qwer="asdf"], Query=[q="test"], IsRetry=true]))
in
    md

enter image description here