Forum Discussion
GET Request o Power BI
- 6 years ago
Hi Williamlima ,
if the body is to be transmitted, it must also be part of the webcall.
let
Json = "{""NomeBanco"":""dashboard_inlog"",""Relatorio"":""Consumo Média Planejada"",""Autenticacao"":""e0d86d356d02b3b8107d5b5015800731"",""Formato"":""chavevalor""}",
ToJsonBinary = Json.FromValue(Json),
WebCall = Web.Contents("http://redentor.inlog.com.br:18090/dashboard/rest/exportarrelatorio", [Content = ToJsonBinary]),
LinesFromBinary = Lines.FromBinary(WebCall)
in
LinesFromBinary
mwegener , good morning.
First of all I would like to thank you for helping me out, second of all I must say that I made a little confusion on the requested method and its POST not GET and i learned a very important lesson today.
So, i managed to make the call work because Power Bi request is a GET by default and mine is a POST. So my query looks like this now:
let
url = "http://redentor.inlog.com.br:18090/dashboard/rest/exportarrelatorio",
body = "{""Relatorio"":""Controle de Desconexões de Equipamentos - MID/AVL"",
""Autenticacao"":""e0d86d356d02b3b8107d5b5015800731"",
""NomeBanco"":""dashboard_inlog"",
""Formato"":""chavevalor""
}",
Source = Json.Document(Web.Contents(url,[
Headers =[#"Content-Type"="application/json"],
Content = Text.ToBinary(body)
]
)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
The way I see, im converting the content to binary but i don't know how to convert back to text. Can you still help me out?.
Thank you.
- mwegener6 years agoMost Valuable Professional
- Williamlima6 years agoFrequent Visitor
- mwegener6 years agoMost Valuable Professional