[whatwg] Re: Radio UserLand: Mail from Ian Hickson

Here's a possible API for GET and POST semantics without XmlHttpRequest:

window.location.href = base URL + URL parameters already appended
window.location.method = GET or POST, nothing else supported

If the method is a POST method, the internal code simply pulls all the 
parameters off of window.location.href and builds up a POST request using 
them.  Should it URL encode each query parameter and key first, or assume 
that they are already URL-encoded?

Brad


At 07:40 AM 4/22/2005, Jon Udell wrote:
>On 4/22/05, radio at spam.hixie.ch <radio at spam.hixie.ch> wrote:
>
> > You write "If JavaScript is going to be an appropriate technology of 
> intermediation, would
> >  it make sense for it to offer an easy way to issue a non-interactive 
> HTTP POST?"
> >
> > Yes, it would. I urge you to send your suggestions to 
> whatwg at whatwg.org, where
> >  we're discussing this kind of thing and writing specs that browsers 
> will be implementing.
>
>OK. Then I do propose an easy way to issue a non-interactive HTTP POST.
>
>As to how, I'm probably the wrong guy to propose something. My first
>thought was that,  if  a list were assigned to location.href, then the
>base URL would be the first element and the URL-encoded data the
>second. This maps to how curl and Python work. But a problem here is
>that POST is only implicit, so what about PUT, DELETE, etc.?
>
>Perhaps one could make a case that POST is important enough to be
>included in the most basic idiom, along with GET, and for other stuff
>there's an advanced idiom?
>
>- Jon

Brad Neuberg, bkn3 at columbia.edu
Senior Software Engineer, Rojo Networks
Weblog: http://www.codinginparadise.org

=====================================================================

Check out Rojo, an RSS and Atom news aggregator that I work on.  Visit 
http://rojo.com for more info. Feel free to ask me for an invite!

Rojo is Hiring!  If you're interested in RSS, Weblogs, Social Networking, 
Java, Open Source, etc... then come work with us at Rojo.  If you recommend 
someone and we hire them you'll get a free iPod!  See 
http://www.rojonetworks.com/JobsAtRojo.html. 

Received on Friday, 22 April 2005 10:51:04 UTC