On 11/30/06, Lee Eschen <[EMAIL PROTECTED]> wrote:
> Bob Ippolito wrote:
> > That's a really bad idea in general. If you want to post, use
> > something like this::
> >
> > var d = doXHR(url, {
> > method: 'POST',
> > 'mimeType': 'text/plain',
> > 'headers': [['Accept', 'application/json']]
> > }).addCallback(MochiKit.Async.evalJSONRequest);
> >
> Bob, can you expand on your comment above? Why is POSTing a bad idea as
> opposed to GETing? Why is your code sample a better idea?
POSTing is a fine idea if and only if the server expects it. POSTing
by default is a really bad idea because it's semantically not a POST
operation. It also thwarts caching altogether, when you really only
want to thwart caching for volatile documents. Not all documents are
volatile.
For example, the MochiKit documentation generates an index dynamically
by fetching the XHTML documents and parsing out the function
definitions. These XHTML documents really don't change much at all and
should be cached.
-bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---