Forum Discussion

sebastianslz's avatar
sebastianslz
Frequent Visitor
4 years ago

How to connect to Webservice REST with POST from Power BI

I am trying to connect to a webservice through Power BI but I still do not achieve result, first try to use the Web data source and with the Advanced Use add the Header that in my case is Content-Type and its value is application/json and additional as Body I have a token

 

Where I get as a result the following:

 

Additional also try to use as source "Blank Query", where I accessed the advanced editor section and add the following Query:

I get as an error the following:

 

To make sure that the Webservice works correctly and obtains a result I have used the Advanced REST Client tool and I have made the following configuration:

Where you can see that the Headers section I have added the Header name Content-Type and the value of the Header Value is application/json, in the Body section is where I have added the token

 

With this I realize that my Webservice gets an answer and that the service is working correctly, I would like someone to give me a little guidance in a short time to perform correctly

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    let
    
        url = ...,
    
        headers = [#"Content-Type" = "application/json"],
    
        postData = Json.FromValue([x = 235.7, y = 41.53]),
    
        response = Web.Contents( url, [ Headers = headers, Content = postData ] ),
    
        jsonResponse = Json.Document(response)
    
    in
    
        jsonResponse