Hey, I'd like to elaborate on the differences in using POST or GET method for your HTTP requests with javascript's XMLHttpRequest object. For all I know, at the moment, the difference in that with php you'd use $_POST with POST methods and $_GET with GET methods.
Please explain in detail the concept, I'm a little confused on this on.
Thanks for reading.
Ajax POST and GET.
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
it's all about how / if you send data with your request.
When you do a GET request, you're only sending the URL, which can pass some limited data in it.
A POST request can send a whole chunk of data with it. Some people send XML, others send form encoded data.
General rule of thumb: If you're getting a update or something, use GET. If you're submitting data, use POST.
jquery has these functions built in, and their descriptions might help clear things up: http://www.visualjquery.com/1.1.1.html
When you do a GET request, you're only sending the URL, which can pass some limited data in it.
A POST request can send a whole chunk of data with it. Some people send XML, others send form encoded data.
General rule of thumb: If you're getting a update or something, use GET. If you're submitting data, use POST.
jquery has these functions built in, and their descriptions might help clear things up: http://www.visualjquery.com/1.1.1.html
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: