Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
jake_rage
New Member

Web.contents auto adding Expect header

I am trying to connect to a graphql API using the follwing:

let
        query = Web.Contents(
            "http:****************",
           [
                Headers=[
                    #"Content-Type"="application/json",
                    #"x-token-id"="1************",
                    #"x-token-value"="W*************"
                ],
                Content = Text.ToBinary(
                     "{""query"": ""query GetEvents { events( filter: { time: { between: [""2024-09-11T00:00:00Z"", ""2024-09-12T00:00:00Z""] } }, first: 1 ) { edges { node { id } } }}""}"
                ),
                Timeout = #duration(0,0,5,0), // Set timeout to 5 minutes
                ManualStatusHandling = {500}  // Handle 500 errors manually
            ]
        ),

        // Handle the response
        StatusCode = Value.Metadata(query)[Response.Status], // Extract status code from metadata
        RawResponse = Text.FromBinary(query),                // Convert raw binary response to text
        ParsedResult = try Json.Document(query) otherwise RawResponse, // Try parsing the result or return raw if it fails

        // Build a structured output for debugging
        Result = if StatusCode = 500 then
                    // Return an error with detailed information
                    Error.Record("ServerError", "500 Internal Server Error", [
                        RawResponse = RawResponse,
                        StatusCode = StatusCode
                    ])
                 else
                    ParsedResult
    in
        // Return the detailed result with status and raw response for debugging
        [StatusCode = StatusCode, RawResponse = RawResponse, Result = Result];

I am getting this error:
statusCode\":500,\"code\":\"FST_REPLY_FROM_INTERNAL_SERVER_ERROR\",\"error\":\"Internal Server Error\",\"message\":\"expect header not supported\"}
Is there anyway to prevent web.Contents from attaching the expect header?

I was able to force the query to work by creating running nginx x server using the follwoing config so I know it is coming from web.contents:
http {
server {
listen 80;

location /graphql {
proxy_set_header Expect "";
proxy_pass https://d*********************;
}
}
}

Thank you for your help
3 REPLIES 3
jake_rage
New Member

Hey yes the Expect header is being set to "100-continue" by web.Contents I dont have the abillity to change the how the api handles headers otherwise I would do that so was hoping there was a way to prevent web.contents from adding it. 

I would call that a bug.

 

If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .

lbendlin
Super User
Super User

Do you see what is specified in the expect header?  application/json ?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.