Solved

AJAX POST or GET

Posted on 2016-07-30
2
44 Views
Last Modified: 2016-08-09
Should I be using POST or GET in my AJAX call?  User fills out a form, the email address is checked to see if it is already in the DB.  If not, the email is entered into the DB and then a confirmation email goes out to that person via plain text php mail();
0
Comment
Question by:rgranlund
2 Comments
 
LVL 24

Expert Comment

by:mankowitz
ID: 41736131
you can use either post or get for an ajax call. It doesn't really make a difference.

By the book, GET should be used for querying a database and POST should be used for updating a database, but again, it doesnt make a difference.
0
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41736913
>>Should I be using POST or GET in my AJAX call?
it depends on where the request posted to, technically you need to check the receiver point whether it accept POST/ GET requests.

since you're posting User details in your form, a POST request is preferred.

the validation of the email address need to be done at server end.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question