Forum Discussion
Problem doing a POST request to download a file with Power Query
Hello. I have made two queries in POSTMAN to be able to download a file from a Rest API.
- In the first query I obtain the session ID resulting from performing a GET with username and password. The headers obtained from this GET are: Host, UserAgent, Accept, Accept-Encoding, Connection and Cookie (with the session ID).
- In the second and last query, I did a POST request with some parameters in the body (action, date, id, parameter1, JSONanswer, parameter2) and in the headers: content-type, accept-encoding, conecction, sec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform, Upgrade-Insecure-Request, User-Agent, Accept, Host, Content-Lenght)
How can i perform the same process with power query? I could make the GET request and i have now a session ID but i dont know how to do the POST request to obtain the same file that i can download doing the POST request in POSTMAN.
Hi Anonymous ,
to transform a GET to a POST request in Power Query you must add a record with a Content-field as a parameter to the call:
Chris Webb's BI Blog: Web Services And POST Requests In Power Query (crossjoin.co.uk)
Transformation of the content can easily be done using the Json.FromValue function:
Easy POST requests with Power BI and Power Query using Json.FromValue – (thebiccountant.com)
1 Reply
- ImkeFCommunity Champion
Hi Anonymous ,
to transform a GET to a POST request in Power Query you must add a record with a Content-field as a parameter to the call:
Chris Webb's BI Blog: Web Services And POST Requests In Power Query (crossjoin.co.uk)
Transformation of the content can easily be done using the Json.FromValue function:
Easy POST requests with Power BI and Power Query using Json.FromValue – (thebiccountant.com)