Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
bharath_sn
Level 7

HTTP POST call using roku for nested data JSON body

Hi All,

I am new to Roku TV app developing. 
1> finding difficulty in executing HTTP post call from BrightScript.
Sample Code
var http_post_body = {
auth_token : abcdef,
user : {
email_id : "sa@gmail.com",
password : "welcome"
}
}

readInternet = createObject("roUrlTransfer")
readInternet.setUrl(m.top.uri)
readInternet.PostFromString(ToStr(http_post_body)) 
print readInternet.getToString()

/*More info*/
- I am using Task node and Screen Graph XML 
- Not able to send nested json in http post calls from Roku


2> We are trying to build multi screen good UI application, please advice me if i need to use Screen Graph XML or Pure Brightscript form of coding.

Thanks and Regards
BHARATH
0 Kudos
1 Reply
joetesta
Level 10

Re: HTTP POST call using roku for nested data JSON body

From my experience thus far, I would recommend avoiding Scene Graph.  It's a learning curve and seems there are disadvantages, I don't see much advantage.  Others may have a different perspective.

Regarding HTTP post, you should be able to start with an example and modify it to get it working.  Regarding nested JSON, I believe you will need to convert to a string prior to POST'ing
aspiring
0 Kudos