Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

How can I download data from the Web, by using the Web. Contents function and there is an API which required request from data in the following format

"__rdxml"=<*Some data*>

I am using this function

...
PostContent = "__rdxml=<*Some data*>",
Source Web.Contents(url,Content=Text.ToBinary(PostContent)) 
... 

And getting an error 400 Bad Request 

1 Answer

0 votes
by (22.5k points)

Use the following measure

let

    actualUrl = "http://some.url",
    record = [__rdxml="some data"],
    body = Text.ToBinary(Uri.BuildQueryString(record)),
    options = [Headers =[#"Content-type"="application/x-www-form-urlencoded"], Content=body],
    result = Web.Contents(actualUrl, options)
in
    result

         To know more about this BI tool in detail, you check out our Power BI Certification     

Related questions

Browse Categories

...