March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear All,
I have been struggling with sending a POST request with an empty body to retrieve data.
The request requires authentication via refresh token which is working fine.
It seems that the Web.Contents is still trying to use GET method.
let
body = null,
Source = Json.Document(Web.Contents("https://www.vptol.co.uk/dlatest/QuestionnaireDataWithProfile?org=whoglmat&typ=WHOData", [Headers=[#"Authorization"="Bearer "&GetAccessTokenForAcasiResponses()], Content=body]))
in
Source
Yield in this error message:
DataSource.Error: Web.Contents failed to get contents from 'https://www.vptol.co.uk/dlatest/QuestionnaireDataWithProfile?org=whoglmat&typ=WHOData' (405): Method Not Allowed
Details:
DataSourceKind=Web
DataSourcePath=https://www.vptol.co.uk/dlatest/QuestionnaireDataWithProfile
Url=https://www.vptol.co.uk/dlatest/QuestionnaireDataWithProfile?org=whoglmat&typ=WHOData
Any help is appreciated.
Kind regards,
thediez
Solved! Go to Solution.
@thediez Can you check that credentials are set to Anonymous for the data source (since using Bearer Token)?
Data source settings > select from the list > Edit Permissions
Hi @OwenAuger ,
Thanks for the suggestion.
I have updated as follows:
let
body = Text.ToBinary(""),
Source = Json.Document(Web.Contents("https://www.vptol.co.uk/dlatest/QuestionnaireDataWithProfile?org=whoglmat&typ=WHOData", [Headers=[#"Authorization"="Bearer "&GetAccessTokenForAcasiResponses()], Content=body]))
in
Source
But now getting this message.
I suspect that adding "Content" in the brackets after "Header" is causing this error.
Kind regards,
Khurshed
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
9 |
User | Count |
---|---|
35 | |
31 | |
20 | |
19 | |
17 |