Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
the Curl where it work
curl --location --request POST "https://MyWebSite:3129/v1/blocklist" ^
--header "X-APIKey: MyKey" ^
--Content-Type"="application/json
the answer is {"error":"Success","response":{"blocklists":[{"blocklistid":"11111111111","name":"Serveur 2008"}]}}
And the powerquery
let
url = "https://MyWebSite:3129/v1/blocklist",
headers = [#"X-APIKey" ="MyKey",
#"Content-Type"="application/json"],
response = Web.Contents(
url,
[ Headers = headers ]
),
jsonResponse = Json.Document(response)
in
jsonResponse
Error from powerquery
DataSource.Error: Web.Contents failed to get contents from 'https://MyWebSite:3129/v1/blocklist' (405): Method Not Allowed
Details:
DataSourceKind=Web
DataSourcePath=https://MyWebSite:3129/v1/blocklist
Url=https://MyWebSite:3129/v1/blocklist
Don't understand why it not working, thx for the help
Solved! Go to Solution.
Ok it good to know I need to specify a payload, but don't know how to apply, I read the website but do not find the info how to apply payload
I try to appy this
let
url = ...,
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([x = 235.7, y = 41.53]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
let
url = "https://my website:3129/v1/blocklist",
headers = [#"X-APIKey" ="my key",
#"Content-Type"="application/json"],
postData = Json.FromValue([""]),
response = Web.Contents(
url,
[ Headers = headers
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
Find the payload
let
url = "https://mywebsite:3129/v1/blocklist",
headers = [#"X-APIKey" ="my key",
#"Content-Type"="application/json"],
body = "{""}",
response = Web.Contents(
url,
[ Headers = headers,
Content = Text.ToBinary((body))
]
),
jsonResponse = Json.Document(response),
response1 = jsonResponse[response],
blocklists = response1[blocklists],
blocklists1 = blocklists{0},
#"Converted to Table" = Record.ToTable(blocklists1)
in
#"Converted to Table"
Ok it good to know I need to specify a payload, but don't know how to apply, I read the website but do not find the info how to apply payload
I try to appy this
let
url = ...,
headers = [#"Content-Type" = "application/json"],
postData = Json.FromValue([x = 235.7, y = 41.53]),
response = Web.Contents(
url,
[
Headers = headers,
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
let
url = "https://my website:3129/v1/blocklist",
headers = [#"X-APIKey" ="my key",
#"Content-Type"="application/json"],
postData = Json.FromValue([""]),
response = Web.Contents(
url,
[ Headers = headers
Content = postData
]
),
jsonResponse = Json.Document(response)
in
jsonResponse
Did it work?
Try
postData = Json.FromValue([x=0]),
I'm quite new to powerbi but how do I specify a payload, could you give me an example?
Or maybe this can work
postData = Json.FromValue([""]),
Please follow the documentation. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-2
You need to specify a payload to make Web.Contents do a POST.
Your API is misbehaving as it accepts POST requests without payloads.
To solve that provide an empty string as the payload.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
40 | |
31 | |
27 | |
27 |