Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have an API call that works in Postman (GET)
It is a OAuth 1.0 authentiacation and I have all keys, secrets and signature.
When I do it in Power Query - I just try to replicate the Headers that Postman.
One of the headers in Postman is "Host" header. Without it - the request doesn't work in Postman. With it - it works.
When I look in Console - it just sends Host: "myurl.com" header.
When I add it in my Power Query request (see in red below) - it suddenly shows an error:
Expression.Error: The 'Host' header must be modified using the appropriate property or method (please see below picture in yellow)
When I click "Edit Settings" - I just get a JSON settings screen - attached.
I tried passing a parameter instead of "myurl.com" - same error.
Other headers don't throw this error.
Without it - it doesn't work either.
Below is the full step code.
Please help!
= Json.Document(Web.Contents("https://myurl.com", [
Headers=[
#"Accept" = "application/schema+json",
#"Authorization"= "OAuth realm=""XXXX"",oauth_consumer_key=""YYY"",oauth_token=""TTTT"",oauth_signature_method=""HMAC-SHA256"",oauth_timestamp=""123456"",oauth_nonce=""ZZZZZ"",oauth_version=""1.0"",oauth_signature=""DDDDDD""",
#"Host" = "myurl.com"
],
RelativePath = "/api/v1/student"
]))
@Anonymous No, sorry, I gave up on this Oauth API and went to ODBC instead...
Hi @michaelsh
Were you able to resolve that issue. I'm also struck with this issue:
Expression.Error: The 'Host' header must be modified using the appropriate property or method.
A little update - I removed the Json.Document, leaving just the Web.Contents part.
I also removed the Accept header.
Same error. Now it I click "Edit Settings" I just see the "From Web" settings where it correctly recognizes my headers.
It just doen't like the "Host" header somehow...
I've played with its values - same error, it just doesn't like this header being there...
Any ideas? Please help...
Hi @michaelsh,
Have tried to use any other methods to invoke your api? AFAIK, normally power query web connector not required 'host' parameters. Maybe you can try to split the authorizations string to standalone parameters and remove 'host'.
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
75 | |
62 | |
51 | |
47 |
User | Count |
---|---|
211 | |
83 | |
64 | |
60 | |
56 |