Forum Discussion
How to run POST request in M?
- 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
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:
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