Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript AJAX Basics (retiring) AJAX Concepts Review HTTP Methods

Nick Retel
PLUS
Nick Retel
Courses Plus Student 4,516 Points

But what if the form contains an email and / or a password.

Then you should definitely use POST imo. Not a great question imo.

1 Answer

Hey Nick,

Are you talking about the question: "When should you use the POST HTTP method with AJAX?"

The options were:

A) Every time you submit information from a form

B) When you want to send data that the web server should store in a database

C) When you want to spend more than 2083 characters of data to the web server

D) All of the above

E) Answers B and C only

You are correct in saying that if the form contains personal or authentication information the HTTP method should be POST. But quite frequently forms will not contain any personal or authentication data. Think search boxes and filter inputs for example. This is why answer A is incorrect. The POST HTTP method is not always required as forms do not always contain sensitive information.