Join 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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 135 | |
| 110 | |
| 50 | |
| 31 | |
| 29 |