Forum Discussion
zoloturu
Memorable Member
8 years agoHow to run POST request in M?
Dear community, I know that Power BI is for ETL, but I'm interested in understanding of all capabilities of it. Did somebody send a POST request to run some action using M (Power Query)? For ...
- 8 years ago
Adding an empty string as the Content-parameter does the trick for me:
Content=Text.ToBinary("")Although the query will then return an error. the refresh actually was successful:
- 8 years ago
Hi ImkeF,
You are correct. It is working for me as well. Thank you!
And to avoid this error we need to add any extra step to return some value.
Here is the final code for this case:
let vToken = AuthorizationToken, vUrl = "https://api.powerbi.com/v1.0/myorg/groups/" & WorkspaceID & "/datasets/" & DatasetID & "/refreshes", Source = Json.Document(Web.Contents(vUrl, [Headers=[Authorization=vToken],Content=Text.ToBinary("")])), result = 1 in resultwhere AuthorizationToken, WorkspaceID and DatasetID are parameters.
Regards,
Ruslan
ImkeF
Community Champion
8 years agoAdding an empty string as the Content-parameter does the trick for me:
Content=Text.ToBinary("")
Although the query will then return an error. the refresh actually was successful:
Skabo_Wenco
3 years agoRegular Visitor
Thank you for this. I have been searching for this answer for 2 years!