Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola amigos,
Estoy tratando de obtener información en Power BI desde un servicio web que ofrece diferentes posibilidades para la solicitud, SOAP GET y POST:
https://ovc.catastro.meh.es/ovcservweb/OVCSWLocalizacionRC/OVCCallejero.asmx?op=Consulta_DNPRC
En ese vínculo, puede ver un ejemplo de cada tipo de solicitud, por ejemplo, para una solicitud GET, el ejemplo es:
GET /ovcservweb/OVCSWLocalizacionRC/OVCCallejero.asmx/Consulta_DNPRC? Provincia-cadena&Municipio-cadena&RC-cadenaHTTP/1.1 Host: ovc.catastro.meh.es
Se trata de datos públicos, por lo que no hay problemas con la autenticación. ¿Cómo puedo hacer esto en Power Query? Necesito usar la última cadena (RC) las otras son opcionales. Si necesita más información por favor no dude en pedirme por ella.
Muchas gracias por la ayuda,
Alfred
Solved! Go to Solution.
Las solicitudes GET se realizan llamando a Web.Contents sin un parámetro Content, las solicitudes POST se realizan llamando a Web.Contents con el parámetro.
Obtener:
let
URL = "http://xxx/tstat",
headers = [#"Content-Type"="application/json"],
web = Web.Contents(URL, [ Headers = headers, ManualStatusHandling = {404, 400}]),
result = Json.Document(web),
...
Exponer:
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),
...
Esto no está funcionando para mí. Estoy intentando ejecutar una API POST sin parámetros. Por favor, ayuda si no hay otras soluciones.
Consulte también https://community.fabric.microsoft.com/t5/Desktop/How-to-run-POST-request-in-M/m-p/457138 para otro código que agregue el parámetro Contenido con vacío a la llamada Web.Contents para forzar que Power BI realice una solicitud POST
Content=Text.ToBinary("")
Las solicitudes GET se realizan llamando a Web.Contents sin un parámetro Content, las solicitudes POST se realizan llamando a Web.Contents con el parámetro.
Obtener:
let
URL = "http://xxx/tstat",
headers = [#"Content-Type"="application/json"],
web = Web.Contents(URL, [ Headers = headers, ManualStatusHandling = {404, 400}]),
result = Json.Document(web),
...
Exponer:
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),
...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |