Forum Discussion

Taurus's avatar
Taurus
Frequent Visitor
6 years ago
Solved

Web.Contents: passing identical keynames in Query subparameter

Hi all   I have this api call:   http://localhost:8080/resto/api/reports/olap?report=SALES&from=01.01.2019&to=18.12.2019&groupRow=WaiterName&groupRow=OpenTime&agr=fullSum&agr=OrderNum   As you...
  • Taurus's avatar
    Taurus
    6 years ago

    I found the final solution, and it is very easy :)

    Thouse keynames duplicates are the array representations for HTTP request parameters, and they can be easily passed through Query subparameter as M-language List representation, e.g. from my first post example:

     

    Data= Web.Contents(
    API_SERVER,
    [RelativePath = "resto/api/reports/olap",
    Query = [report="SALES", from="01.01.2019", to="18.12.2019",groupRow={"WaiterName", "OpenTime"}, agr={"fullSum", "OrderNum"}]

    ]
    )

     

    The record fields of Query - groupRow and agr - are passed as Lists - and this works :)