btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2017
11:36 AM
Send roarray to server
Trying to pass a roarray to my server thru the url. I can do string with no problem but getting a type mismatch when setting the url. Looks something like
I can use the same code and include and send one element of the array as a string and works fine
Can the entire array be sent at one time. Thought about looping thru myarray but thought there had to be another way to avoid making so many calls.
serverurl="http://myserver/myserversecript.php?filename="+myfile+"&myarray="+myarray
I can use the same code and include and send one element of the array as a string and works fine
serverurl="http://myserver/myserversecript.php?filename="+myfile+"&myarray="+myarray[0].title
Can the entire array be sent at one time. Thought about looping thru myarray but thought there had to be another way to avoid making so many calls.
2 REPLIES 2
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2017
12:39 PM
Re: Send roarray to server
I would do something like this:
ut = CreateObject("roUrlTransfer")
myfileEscaped = ut.Escape(myfile)
myarrayJson = FormatJson(myarray)
myarrayJsonEscaped = ut.Escape(myarrayJson)
serverurl="http://myserver/myserversecript.php?filename="+myfileEscaped+"&myarray="+myarrayJsonEscaped
btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2017
05:48 AM
Re: Send roarray to server
"belltown" wrote:
I would do something like this:ut = CreateObject("roUrlTransfer")
myfileEscaped = ut.Escape(myfile)
myarrayJson = FormatJson(myarray)
myarrayJsonEscaped = ut.Escape(myarrayJson)
serverurl="http://myserver/myserversecript.php?filename="+myfileEscaped+"&myarray="+myarrayJsonEscaped
Thanks belltown, this worked.