Re: A URL API

2010-09-21 Thread Darin Fisher
On Mon, Sep 20, 2010 at 11:02 AM, Garrett Smith dhtmlkitc...@gmail.comwrote: On 9/20/10, Julian Reschke julian.resc...@gmx.de wrote: On 20.09.2010 18:56, Garrett Smith wrote: [...] Requests that don't have lot of parameters are often simple one-liners: url = /getShipping/?zip= + zip +

Re: A URL API

2010-09-21 Thread Devdatta Akhawe
or any webservice that likes to have lots of query parameters - Google Search for example. In general, why would you not want a robust way to make complicated queries - those who are making simple queries and prefer simple one liners can continue using it. On 20 September 2010 23:42, Darin

Re: A URL API

2010-09-21 Thread Adam Barth
Ok. I'm sold on having an API for constructing query parameters. Thoughts on what it should look like? Here's what jQuery does: http://api.jquery.com/jQuery.get/ Essentially, you supply a JSON object containing the parameters. They also have some magical syntax for specifying multiple

Re: A URL API

2010-09-21 Thread Devdatta Akhawe
+1 for 2 APIs - this whole multiple parameters with the same value is too annoying imho and unnecessary for new web services . It should be there only for old services that are also accessed via basic HTML forms cheers devdatta On 20 September 2010 23:56, Adam Barth w...@adambarth.com wrote:

Re: A URL API

2010-09-21 Thread Ojan Vafai
How about setParameter(name, value...) that takes var_args number of values? Alternately, it could take either a DOMString or an ArrayDOMString for the value. I prefer the var_args. Also, getParameterByName and getAllParametersByName seem unnecessarily wordy. How about

Re: A URL API

2010-09-21 Thread Devdatta Akhawe
On 21 September 2010 00:47, Ojan Vafai o...@chromium.org wrote: How about setParameter(name, value...) that takes var_args number of values? Alternately, it could take either a DOMString or an ArrayDOMString for the value. I prefer the var_args. What happens when I do

Re: A URL API

2010-09-21 Thread Adam Barth
On Tue, Sep 21, 2010 at 12:51 AM, Devdatta Akhawe dev.akh...@gmail.com wrote: On 21 September 2010 00:47, Ojan Vafai o...@chromium.org wrote: How about setParameter(name, value...) that takes var_args number of values? Alternately, it could take either a DOMString or an ArrayDOMString for the

Re: A URL API

2010-09-21 Thread Garrett Smith
On 9/21/10, Ojan Vafai o...@chromium.org wrote: How about setParameter(name, value...) that takes var_args number of values? Alternately, it could take either a DOMString or an ArrayDOMString for the value. I prefer the var_args. Why? A user-defined fallback will be necessary for a while.

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Anne van Kesteren
On Tue, 21 Sep 2010 02:05:10 +0200, Jonas Sicking jo...@sicking.cc wrote: CORS was recently clarified to say that error responses, such as 4xx/5xx responses, should not abort the various algorithms but instead such a response should be forwarded to, for example, the XMLHttpRequest

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Nathan
Anne van Kesteren wrote: On Tue, 21 Sep 2010 02:05:10 +0200, Jonas Sicking jo...@sicking.cc wrote: CORS was recently clarified to say that error responses, such as 4xx/5xx responses, should not abort the various algorithms but instead such a response should be forwarded to, for example, the

Re: A URL API

2010-09-21 Thread Mihai Parparita
On Mon, Sep 20, 2010 at 11:02 AM, Garrett Smith dhtmlkitc...@gmail.com wrote: IOW, what are the cases where an XHR instance wants to use a lot o query params? I'm sure there are other examples, and it depends by what you mean by a lot, but here are all the parameters that Google Reader sends

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Julian Reschke
On 21.09.2010 11:04, Anne van Kesteren wrote: On Tue, 21 Sep 2010 02:05:10 +0200, Jonas Sicking jo...@sicking.cc wrote: CORS was recently clarified to say that error responses, such as 4xx/5xx responses, should not abort the various algorithms but instead such a response should be forwarded to,

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Anne van Kesteren
On Tue, 21 Sep 2010 11:44:46 +0200, Julian Reschke julian.resc...@gmx.de wrote: All 2xx codes are success codes. Sure, but the others make no sense in this context and simply checking for 200 is easier than checking for a range. -- Anne van Kesteren http://annevankesteren.nl/

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Julian Reschke
On 21.09.2010 11:48, Anne van Kesteren wrote: On Tue, 21 Sep 2010 11:44:46 +0200, Julian Reschke julian.resc...@gmx.de wrote: All 2xx codes are success codes. Sure, but the others make no sense in this context and simply checking for 200 is easier than checking for a range. How do you know

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Julian Reschke
On 21.09.2010 11:58, Anne van Kesteren wrote: On Tue, 21 Sep 2010 11:53:39 +0200, Julian Reschke julian.resc...@gmx.de wrote: How do you know now that 234 will not make sense in two years from now? Common sense. But apart from that it seems saner to just operate from a whitelist here. We only

Re: [CORS] HTTP error codes in preflight response

2010-09-21 Thread Anne van Kesteren
On Tue, 21 Sep 2010 12:04:44 +0200, Julian Reschke julian.resc...@gmx.de wrote: To address use case we currently don't know of. Remember, extensibility. We can easily allow more status codes when the use cases exists. That would also be better in case client updates are required. --

Re: A URL API

2010-09-21 Thread Doug Schepers
Hi, Adam- I really like this idea. Of course there are scripts out there that do most (all?) of this, but exposing it as an interface seems useful to me. I proposed something similar in my SVG Params spec [1][2][3], though yours is better thought out. One difference is that I was

Re: A URL API

2010-09-21 Thread Devdatta Akhawe
Perhaps appendParameter(x, a, b, c) ? where appendParameter is the second API - separate from setParameter? so appendParmeter(x',a,b,c); setParameter(x,a) would result in ?x=a and without the second function call it would be ?x=ax=bx=c I am fine with this. cheers devdatta Adam

Re: A URL API

2010-09-21 Thread Tab Atkins Jr.
On Mon, Sep 20, 2010 at 11:56 PM, Adam Barth w...@adambarth.com wrote: Ok.  I'm sold on having an API for constructing query parameters. Thoughts on what it should look like?  Here's what jQuery does: http://api.jquery.com/jQuery.get/ Essentially, you supply a JSON object containing the

Re: Widgets - WARP, Widgets Updates and Digital Signatures

2010-09-21 Thread Mike Hanson
Hi - just wanted to note that Mozilla Labs people are here and listening. There are people in the labs group that are very interested in web application deployment into the main browser context. We are not particularly focused on widgets per se (as has been noted there are many runtimes for

Re: A URL API

2010-09-21 Thread Ojan Vafai
appendParameter/clearParameter seems fine to me. On Wed, Sep 22, 2010 at 2:53 AM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Mon, Sep 20, 2010 at 11:56 PM, Adam Barth w...@adambarth.com wrote: Ok. I'm sold on having an API for constructing query parameters. Thoughts on what it should