Forum Discussion

jitpbi's avatar
jitpbi
Icon for Post Patron rankPost Patron
5 years ago
Solved

add timeout in advanced editor

Hi,   I am trying to add timeout ([Timeout=#duration(0,2,0,0)]) to the API to get data from a web source but somehow i am not able to do it succesfully.  Please suggest how to add [Timeout=#durati...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi jitpbi,

    As official document mention, the 'timeout' property should be an optional parameter that host in the same level as 'relativepath' and 'header'.

    Web.Contents 
    I think you can try to add a comma after the 'query' and append it with the 'timeout' property.

    let
        rooturl = "https:/xxxx.xxxx.com/",
        authKey = "xxxxx",
        Source =
            Web.Contents(
                rooturl,
                [
                    Headers = [
                        #"Authorization" = authKey,
                        #"Content-Type" = "application/json"
                    ],
                    RelativePath = "xxx/xxx/xxx",
                    Query = [
                        startdate = xxxx,
                        enddate = xxxx
                    ],
                    Timeout = #duration(0, 0, 35, 0)
                ]
            )
    in
        Source

    Regards,

    Xiaoxin Sheng