Reply
pranaysharmaman
Regular Visitor
Partially syndicated - Outbound

How to retrieve custom response headers from a URL using Web Headers

I'm trying to make a call to a REST API that returns the total count of rows in a header X-Total-Count.

However when making a call through Power BI, the Web.Headers only retrieves generic response headers like Content-Type, Server etc.

How can I specify the call or maybe an alternate way to retreive the custom response header X-Total-Count?

8 REPLIES 8
jprdynamicapps
Helper IV
Helper IV

Syndicated - Outbound

The headers available through Power Query are a small subset of what comes back. Unfortunately, Power Query filters out the rest. The only way to get them is to write a custom connector.

 

Upvote suggestion to get all headers back here: https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=e47d7520-1509-ed11-b5cf-281878de6c19

cemo
New Member

Syndicated - Outbound

I am facing the same issue and can not still figure out it

v-henryk-mstf
Community Support
Community Support

Syndicated - Outbound

Hi @pranaysharmaman ,

 

The supported parameters are of the following types.

vhenrykmstf_0-1657877821192.png

let
    searchText = "Power Query"
in
    Web.Headers(
        "https://www.bing.com",
        [
            RelativePath = "search",
            Query = [q = searchText]
        ]
    )

related document link:

Web.Headers - PowerQuery M | Microsoft Docs


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Syndicated - Outbound

This also has the same limitation.

The headers returned are only generic ones. 

Power BI only returns following headers - 

pranaysharmaman_0-1657902698219.png

 

Postman returns - 

pranaysharmaman_1-1657902742989.png

Majority of headers are missing from Power BI

danextian
Super User
Super User

Syndicated - Outbound

Hi @pranaysharmaman 

 

These might be able to pull the information you need.

Table.FromColumns({Lines.FromBinary(Web.Contents("url"), null, null, 65001)})
= Web.BrowserContents("url")




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Syndicated - Outbound

These only return the "body". I'm interested in a "header" (custom response header called X-Total-Count)

Syndicated - Outbound

Did you ever figure this out?

Syndicated - Outbound

Up...

Never figured this out neither

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)