Actually I am sending data to the server from a form so post is needed. But I do agree that normally get is teh better method if you don't need to send data to a server.
Joey On Wed, Aug 12, 2009 at 2:27 PM, Michael Geary <m...@mg.to> wrote: > > > > From: Michael Geary > > > Just use $.getJSON() or $.ajax() with the 'json' or 'jsonp' > > > dataType as needed. > > > From: Stephan Beal > > Speaking of: i recommend AGAINST using getJSON() because it > > muddles up my Apache logs horribly (the JSON gets encoded in > > the request, which gets logged as urlencoded garbage). JSON > > should, IMO, be sent over POST. > > I just replied to a similar point in another thread, but just for anyone > who > is reading this thread... > > Your point is well taken about *uploading* JSON data with POST instead of > GET. In that case, using JSON.stringify() and putting the data in a POST > would be a very good idea. (If you're updating data on the server, then you > should be using POST instead of GET anyway, even if you weren't using > JSON.) > > But if you're just *downloading* JSON data and not updating state on the > server, then you may as well just use a GET. The query parameters from the > GET will show up in your server log, but those aren't that lengthy in a > typical GET request. > > -Mike > >