Forum Discussion
Add a body to web.contents
Hello! I want to add a body to this code:
let
url = "https://pos.linisco.com.ar/sale_orders",
Source = Json.Document(Web.Contents(url, [Headers = [#"Content-Type"="application/json", #"Accept"="application/json", #"X-User-Email"="xxxxxx", #"X-User-Token"="xxxxxx"]])),
in
Source
The body in postman is:
3 Replies
- v-yalanwu-msft
Community Support
Hi, -jmdaher- ;
You could refer to Solution from here: https://eriksvensen.wordpress.com/2014/09/15/specifying-json-query-in-power-query-example-statistics...
let content = "{ ""from date"": ""1/1/2022"", ""to date"": ""12/11/2022"", }", Source = Json.Document(Web.Contents("https://api-sandbox.direct.yandex.com/json/v5/campaigns", [Headers=[Authorization="Bearer AQAAAAANlKwBAAQQn4Wfgbxxxxxxxxxx"], Content=Text.ToBinary(content)])) in Source
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- -jmdaher-Regular Visitor
I tried with this and I didn´t have a result:
This is the error:
DataSource.Error: Web.Contents failed to get contents from 'https://pos.linisco.com.ar/sale_orders' (404): Not Found
Details:
DataSourceKind=Web
DataSourcePath=https://pos.linisco.com.ar/sale_orders
Url=https://pos.linisco.com.ar/sale_ordersI don´t know how to resolve it.
- AnonymousNot applicable
I receive an error:
DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously.