Is 2 not incorrect? That should be "foo[]=a&foo[]=b" if I'm not
mistaken... On the server side you will get foo=b. Similarly for 3 you
will get foo=c.

I haven't looked at the code or thought about it much, but I would
like to see recursion of hashes and arrays. If you do 4, I would guess
that taking it all the way shouldn't be much harder.

{ foo:{bar:['a','b','c']}} => "foo[bar][]=a&foo[bar][]=b&foo[bar][]=c"

As for arrays, I think they should be given indexes because it would
more accurately reproduce the original data structure and with a good
recursion scheme probably be easier to code (but that's just
speculation).
{ foo:[['a','b'],['c','d']]} => "foo[0][0]=a&foo[0][1]=b&foo[1]
[0]=c&foo[1][1]=d"
{ foo:['a', ['b'], 'c']} => "foo[0]=a&foo[1][0]=b&foo[2]=c"
{ foo:['a',{bar:'baz',baz:'zab'},'c']} => "foo[0]=a&foo[1]
[bar]=baz&foo[1][baz]=zab&foo[2]=c"

I would probably find this stuff very useful in the future if it was
fully featured.
I've setup a simple test page to test such query strings here:
http://colin.mollenhour.com/posttest.php

I assume pretty much every server-side language will treat these the
same way, and performance probably isn't critical, so why not go the
whole nine? Just my .02

Colin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to