jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:17 PM
maximum URL length?
Is there a limit to the size of urls that an RoUrlXfer will digest?
xfer = CreateObject("roURLTransfer")
xfer.seturl("http://www.google.com")
?xfer.geturl()
http://www.google.com
url="http://api.soundcloud.com/tracks.xml?consumer_key=----------------------&limit=21&offset=0&order=hotness&created_at[from]=2010-8-24"
xfer.seturl(url)
?xfer.GetUrl()
http://www.google.com
xfer.SetUrl("http://www.ibm.com")
?xfer.GetURl()
http://www.ibm.com
xfer.setURL("http://api.soundcloud.com/tracks.xml?consumer_key=----------------------&limit=21&offset=0&order=hotness&created_at[from]=2010-8-24")
?xfer.GetURl()
http://www.ibm.com
So that is why I've been tearing my hair out... Is this a bug or is there a reason for this? Any useful workarounds? now I know why my app broke last night when I added "&created_at[from]=2010-8-24" to the end of the URL, and why it broke in a way I couldn't trace easily (poster items showing up in the wrong category... because the URL didn't change)
xfer = CreateObject("roURLTransfer")
xfer.seturl("http://www.google.com")
?xfer.geturl()
http://www.google.com
url="http://api.soundcloud.com/tracks.xml?consumer_key=----------------------&limit=21&offset=0&order=hotness&created_at[from]=2010-8-24"
xfer.seturl(url)
?xfer.GetUrl()
http://www.google.com
xfer.SetUrl("http://www.ibm.com")
?xfer.GetURl()
http://www.ibm.com
xfer.setURL("http://api.soundcloud.com/tracks.xml?consumer_key=----------------------&limit=21&offset=0&order=hotness&created_at[from]=2010-8-24")
?xfer.GetURl()
http://www.ibm.com
So that is why I've been tearing my hair out... Is this a bug or is there a reason for this? Any useful workarounds? now I know why my app broke last night when I added "&created_at[from]=2010-8-24" to the end of the URL, and why it broke in a way I couldn't trace easily (poster items showing up in the wrong category... because the URL didn't change)
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
17 REPLIES 17

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:39 PM
Re: maximum URL length?
I think the problem is actually with your URL itself, not the length. You should URL encode your square brackets...
http://api.soundcloud.com/tracks.xml?consumer_key=----------------------&limit=21&offset=0&order=hotness&created_at%5bfrom%5d=2010-8-24
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:41 PM
Re: maximum URL length?
The problem is the square brackets. Replace them with %1B and %1D respectively.
Endless beat me to it!
-JT
Endless beat me to it!
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:42 PM
Re: maximum URL length?
"renojim" wrote:
The problem is the square brackets. Replace them with %1B and %1D respectively.
Endless beat me to it!
-JT
%5B and %5D... not 1...
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:44 PM
Re: maximum URL length?
Would there be any benefit / problem with running the whole URL through URLEncode?
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:47 PM
Re: maximum URL length?
I've had mixed results with UrlEncode. I'd try it with whatever site you're trying to connect to and see if it works. In my case, I wanted some things encoded but not others and encoding everything didn't work. I believe it should work, but you never know until you try.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:49 PM
Re: maximum URL length?
"TheEndless" wrote:"renojim" wrote:
The problem is the square brackets. Replace them with %1B and %1D respectively.
Endless beat me to it!
-JT
%5B and %5D... not 1...
Oops! That's what I get for trying to beat you to the punch!
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
10:50 PM
Re: maximum URL length?
You can't do the whole URL, because it will encode the slashes, ampersands, and equals. You only want to URL encode the querystring parameters and values.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
11:03 PM
Re: maximum URL length?
"TheEndless" wrote:
You can't do the whole URL, because it will encode the slashes, ampersands, and equals. You only want to URL encode the querystring parameters and values.
And just so it's completely obvious to anyone who's just learning this, you encode the parameters and values not the whole query string. That is, you can't encode "foo=bar&this=that" as the "=" and "&" will be encoded (that's how you pass them in as variables). You need to encode each parameter name and value separately.
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2010
11:34 PM
Re: maximum URL length?
Ok, so just to make sure I get it, what is the criteria for whether a character should be URL encoded? one website I looked at said "all non-alphanumerics", but I think I really only want the "weird" characters like spaces and brackets?
- Joel
- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!