Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Build a Simple Dynamic Site with Node.js Creating a Simple Server in Node.js Preparing & Planning

Joseph Acevedo
Joseph Acevedo
10,800 Points

Why are we using POST?

I'm just curious as to why we're using the POST method to get data? I thought POST was only used to make changes to files that exist on that server?

Marie Nipper
Marie Nipper
22,638 Points

I'm no expert, but my understanding is the GET request tells the server to send the said resource you're asking for.

But, the POST request in our instance says 'Server, take into account WHAT I am first sending you, then send me the appropriate resource back.'

With GET you're asking for data from some resource and POST you're submitting data to the server, then in our lesson, asking for a response based on what was sent.

I was wondering the same thing