Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 9

How can pass roAssociativeArray in URL parameters?

Can we request URL with roAssociativeArray parameters? as below :-

GetFunction([{"option_id" : "7", "option_value" : 24}, {"option_id" : "8", "option_value" : 27}])

options = [{"option_id" : "7", "option_value" : 24}, {"option_id" : "8", "option_value" : 27}]


I have requested above URLs but I am getting error, my code is-
function GetFunction(url)
        request = CreateObject("roUrlTransfer")
        request.AddHeader("X-Roku-Reserved-Dev-Id", "")
        request.AddHeader("Content-Type", "application/json")
        port = CreateObject("roMessagePort")
        timer = createobject("roTimeSpan")
        while true
            msg = wait(0, port)
            if type(msg) = "roUrlEvent" then
                return "OK"
                exit while
            end if       
        end while
end function

Please advice. How to reuqest thes type of URLs in RokuSG?
0 Kudos
1 REPLY 1\
Level 9

Re: How can pass roAssociativeArray in URL parameters?

GetFunction(""+"[{'option_id' : '7', 'option_value': 24}]")

Obviously I can't test it but this doesn't throw a syntax error like yours did.
Kinetics Screensavers
0 Kudos