Forum Discussion

lauritxi's avatar
lauritxi
Frequent Visitor
8 years ago
Solved

Retrieve API response headers

I have an API query from Power BI Desktop that looks like this:   let authKey = "Basic " & Binary.ToText(Text.ToBinary("UserID" & ":" & "PassWD"),0), url="https://mywebapi.com", Source = Json.D...
  • lauritxi's avatar
    lauritxi
    8 years ago

    Hi, 

    I understand that they are methods to obtain the request headers, not response headers.

     

    In this article:

    https://www.poweredsolutions.co/2017/09/04/guide-and-resources-for-web-data-extraction-with-power-bi-power-query/

     

    explains this:

     

    "[...] but even with those articles and videos at hand + the full documentation of the Web.Contents function here, you might not get some queries to work because of how Power Query’s refresh operation was designed to work on the Power BI Service and how some other features are limited like not being able to see the response header of your Web.Contents request when using the Value.Metadata function"

     

    So, the conclusion I get is that the only way to get all the information from the  responseheaders is to create a Custom Connector.

     

    "[...] Request Limit, Throttling, Token expiration and response Headers– a big restriction with Power Query is that, by design, you are unable to see the headers of the response of your requests. You only get the body of the response, but the Header contains important information, like the next page url, total elements in the endpoint and more. Now with the Extensibility Model you are able to see exactly what the response Header provides and use the values to paginate or just create a query plan for your connector so you never get throttled."

     

    Thank you all.