Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Guys,
4. The code I'm using is here:
But I'm getting the following error:
Expression.Error: The 'Host' header must be modified using the appropriate property or method.
Any ideas about how to solve it:
BR
/Pato
Just try to remove it from the query.
You need to have it else you get 400 response. See below.
DataSource.Error: Web.Contents failed to get contents from 'https://www.vinmonopolet.no/vmp/store-pickup/295306/pointOfServices' (400): Bad Request
Details:
DataSourceKind=Web
DataSourcePath=https://www.vinmonopolet.no/vmp/store-pickup/295306/pointOfServices
Url=https://www.vinmonopolet.no/vmp/store-pickup/295306/pointOfServices
I see the same problem not only with Host, but with with Content-Type as well. I found this post regarding the problem - http://blogs.clariusconsulting.net/kzu/setting-http-headers-in-net-this-header-must-be-modified-usin...
And I get 400 responce without these parameters as well.
Possibly guys from Power Query team modify headers using not appropriate C class level ;-).
I continued to investigate the case, and found that:
- Power Query automatically adds Host and Content-length headers. I watched that, using Whiteshark for sniffering traffic, created by Power Query. So the error, mentioned in the post, happens because:
1. we try to override the headers, wich is already prepared automatically, and
2. implementation of overriding these headers contains errors I mentioned previously.
But - possibly 2. is done intentionally, because we have no obvious reasons to override these 2 headers - automatically generated values meet the needs of the web-service in my case.
As for error 400 - in my case it ... disappeared today. I'm still try understand what happened, but at least my current understanding is that 400 responce is due to some mistakes in the service or in intermediators (protocol stack, Windows miracles etc.) and not due to mistakes in making call of the service from Power Query.
AND - be careful - in my case, if you havigate to XML content of Web.Contents via UI of Power Query (so it adds Xml.Tables to Web.Contents), PQ automatically cut Headers clause from Web.Contents parameters, beleive it or not :-). And it happens in both Excel and PB Desctop PQs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |