Forum Discussion
Access data from POST API
- Anonymous6 years ago
HI Anonymous,
>>DataSource.Error: The downloaded data is HTML, which isn't the expected type. The URL may be wrong or you might not have provided the right credentials to the server.
Perhaps this issue appears when you try to use the wrong connector to recognize response data.
I'd like to suggest you navigation to the 'Source' step to confirm the result type and change to the corresponding connector in the next steps to recognize/analytics records.Regards,
Xiaoxin Sheng
Hi lbendlin,
Thanks for the reply.
Yes I have another link as well as Payload contains the username and password to access the data from the given link
Thanks
Here is an example. Use Json.FromValue to binary encode your payload
let
URL = "http://xxx/tstat",
headers = [#"Content-Type"="application/json"],
data = Json.FromValue([tmode = 2,t_cool = Setpoint,hold = 0]),
web = Web.Contents(URL, [ Content = data, Headers = headers, ManualStatusHandling = {404, 400}]),
result = Json.Document(web)
in
result
- Anonymous6 years agoNot applicable
- lbendlin6 years ago
Super User
This is Power Query (also referred to as M) . You use that to connect to your data sources.
If you are new to Power BI then you may want to start with an easier project. Running POST calls is rather advanced.
- Anonymous6 years agoNot applicable
Hi lbendlin
Sorry It's my bad, I mean to say, is it need to type in the Advance editor of Power Query Editor?
Also having one question, Where to add the Header Name (i.e,- X-Token) and jwd token generated from the payload.